Page 1 of 3

FarNet - .NET Far API and .NET plugin manager (English)

Posted: Sun 08 Mar, 2009 16:44
by NightRoman
English speaking .NET developers are welcome to use and discuss the FarNet plugin
http://code.google.com/p/farnet/

Re: FarNet - .NET Far API and .NET plugin manager (English)

Posted: Sun 03 Apr, 2011 04:05
by senpost
I have folder full of shortcuts to access my favorite folders from Run box. To access these folders in FAR I tried few approaches, FAR Folder Shortcuts, I can have only 10 shortcuts and I need more. I have been using User Menu to do this. So far so good, except that I have to remember HotKey for each folder.

So I wrote a simple FarNet ModuleCommand, it takes the shortcut name and opens the target in the active panel.
I have few questions on this,
1. ModuleCommand must end with ":" , Is it true? How do I change this to some other character like ";"?
2. Can you provide a little code snippet to Open a superPanel with few files in it? I am going to take a look at your Explore command and see if it helps me anyway.

Thank you as always.

Re: FarNet - .NET Far API and .NET plugin manager (English)

Posted: Sun 03 Apr, 2011 05:19
by NightRoman
1) The symbol that separates command prefix and text is ":"; it is defined by Far Manager and it is not configurable, as far as I know.

2) One code snippet is the class FarNet.Tools.SearchFileCommand (see void Invoke(Panel sourcePanel)):
http://farnet.googlecode.com/svn/trunk/ ... Command.cs


But why you are going to use the super panel is not quite clear to me. Basically "super" means that it is "panel with files from other panels". That implies you have to have your panel with your files in the first place, then you can use the super panel (for search results, as a temp panel, etc.). Do you already have your own panels/explorers in order to use them with the super panel?

Re: FarNet - .NET Far API and .NET plugin manager (English)

Posted: Sun 03 Apr, 2011 05:35
by NightRoman
Perhaps you actually want to write you own panel (a child of the Panel class with its child of the Explorer class that provides files), not use the super panel. Having your panel opened and some files in it you can indeed use the Explore module/command in order to search your files; but this part does not need any programming, it's a tool ready to use.

Re: FarNet - .NET Far API and .NET plugin manager (English)

Posted: Sun 03 Apr, 2011 05:55
by NightRoman
A few thoughts about your original task. I also use Far Folder Shortcuts -- yes, only for a few very often used folders. For others I also use the user menu. For some reason I do not have issues with keeping hotkeys in mind :). But if I have I would create a macro like this:

Code: Select all

F2 <keys to open the menu> CtrlAltF
The last CtrlAltF (often overlooked feature) activates incremental filtering in the result menu: type any substring that you can remember and the filter is applied incrementally to the menu items as far as you are typing. Needles to say, that menu item names are your folder shortcut names.

Re: FarNet - .NET Far API and .NET plugin manager (English)

Posted: Sun 03 Apr, 2011 16:54
by HaRT
senpost
To open folders by their assigned designatins is what the NamedFolders plugin has been doing for years. Give it a try — it's very powerful.

Re: FarNet - .NET Far API and .NET plugin manager (English)

Posted: Sun 03 Apr, 2011 23:57
by senpost
NightRoman wrote:
The last CtrlAltF (often overlooked feature) activates incremental filtering in the result menu: type any substring that you can remember and the filter is applied incrementally to the menu items as far as you are typing. Needles to say, that menu item names are your folder shortcut names.
Thank you, CtrlAltF is really useful.

Re: FarNet - .NET Far API and .NET plugin manager (English)

Posted: Mon 04 Apr, 2011 00:03
by senpost
NightRoman wrote:Perhaps you actually want to write you own panel (a child of the Panel class with its child of the Explorer class that provides files), not use the super panel.
Maybe I dont want to use SuperPanel. If I want to list some random files in a panel, What kind of panel I have to use. Can you post some code snippet please.

Re: FarNet - .NET Far API and .NET plugin manager (English)

Posted: Mon 04 Apr, 2011 05:36
by NightRoman
If I want to list some random files in a panel, What kind of panel I have to use. Can you post some code snippet please.
You mean any files and you need any example code? Then take a look at Test-Explorer-.ps1 from PowerShellFar. It is a PowerShell script but it gives an idea how C# code for panels should look like. The only difference is that in C# you derive your classes from Panel and Explorer and override proper methods.

Also, the PowerShellFar module itself uses several panels, you may want to take a look at the sources. That code is more difficult for learning than demos but on the other hand it might be more useful for doing real things: http://code.google.com/p/farnet/source/ ... r%2FPanels

Re: FarNet - .NET Far API and .NET plugin manager (English)

Posted: Thu 14 Jul, 2011 15:22
by senpost
Is there a way, I can create a panel with a text box on top and viewer & list box on the bottom. Idea behind this is to let user type some command in the text box and then display results in the viewer or list box.

Re: FarNet - .NET Far API and .NET plugin manager (English)

Posted: Thu 14 Jul, 2011 15:26
by HaRT
senpost
AFAIK, a PowerShellFar plugin panel can display objects returned by a PowerShell script run inside Far.
And the FarCmds plugin can open console program's text output in an editor/viewer. It hides the panels though.

Re: FarNet - .NET Far API and .NET plugin manager (English)

Posted: Thu 14 Jul, 2011 15:29
by NightRoman
It is possible. Is it going to be a dialog (i.e. not panel)? Panel is a completely different beast. I would use a list box for results (or a custom control).

Re: FarNet - .NET Far API and .NET plugin manager (English)

Posted: Thu 14 Jul, 2011 15:39
by NightRoman
Or is this going to be really a panel with a box on top and a list at bottom? I do not think this is a good way to go (even if this is possible).

Re: FarNet - .NET Far API and .NET plugin manager (English)

Posted: Thu 14 Jul, 2011 15:43
by senpost
How FAR displays tree view or Info panel? Those are kind of different than panel, Can a plugin create some custom control and host it in any one of the panels?

Re: FarNet - .NET Far API and .NET plugin manager (English)

Posted: Thu 14 Jul, 2011 15:48
by senpost
NightRoman wrote:Or is this going to be really a panel with a box on top and a list at bottom? I do not think this is a good way to go (even if this is possible).
Why do you think that? You may argue that I can use command line with FAR command to achieve this. I kind of want it to take this little further with my own custom panel/window.