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

Here you can discuss about your favorite plug-in.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

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

Post by NightRoman »

English speaking .NET developers are welcome to use and discuss the FarNet plugin
http://code.google.com/p/farnet/
User avatar
senpost
Posts: 53
Joined: Fri 27 Mar, 2009 03:54

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

Post 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.
"To us all towns are one, all men our kin"
Kanniyan Poongundran, Tamil Poet, 500 BC
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

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

Post 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?
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

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

Post 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.
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

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

Post 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.
User avatar
HaRT
Moderator
Posts: 10806
Joined: Tue 30 Aug, 2005 17:21
Has thanked: 220 times
Been thanked: 357 times

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

Post 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.
Фар есть инструмент, а не нянька. © 2009 DrKnS
User avatar
senpost
Posts: 53
Joined: Fri 27 Mar, 2009 03:54

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

Post 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.
Last edited by senpost on Thu 01 Jan, 1970 01:00, edited 0 times in total.
Reason: Overquoting
"To us all towns are one, all men our kin"
Kanniyan Poongundran, Tamil Poet, 500 BC
User avatar
senpost
Posts: 53
Joined: Fri 27 Mar, 2009 03:54

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

Post 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.
Last edited by senpost on Thu 01 Jan, 1970 01:00, edited 0 times in total.
Reason: Overquoting
"To us all towns are one, all men our kin"
Kanniyan Poongundran, Tamil Poet, 500 BC
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

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

Post 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
User avatar
senpost
Posts: 53
Joined: Fri 27 Mar, 2009 03:54

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

Post 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.
"To us all towns are one, all men our kin"
Kanniyan Poongundran, Tamil Poet, 500 BC
User avatar
HaRT
Moderator
Posts: 10806
Joined: Tue 30 Aug, 2005 17:21
Has thanked: 220 times
Been thanked: 357 times

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

Post 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.
Фар есть инструмент, а не нянька. © 2009 DrKnS
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

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

Post 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).
User avatar
NightRoman
Posts: 6184
Joined: Fri 18 Aug, 2006 13:52
Location: Cambridge, UK
Has thanked: 32 times
Been thanked: 62 times
Contact:

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

Post 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).
User avatar
senpost
Posts: 53
Joined: Fri 27 Mar, 2009 03:54

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

Post 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?
"To us all towns are one, all men our kin"
Kanniyan Poongundran, Tamil Poet, 500 BC
User avatar
senpost
Posts: 53
Joined: Fri 27 Mar, 2009 03:54

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

Post 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.
"To us all towns are one, all men our kin"
Kanniyan Poongundran, Tamil Poet, 500 BC
Post Reply

Return to “General Plug-In Discussions”