TutorialDeveloping C# plugins for FARR is now easier than ever. To create your first plugin follow these steps:1) Run Visual Studio 20052) File -> New Project -> Visual C# -> FARR C# plugin (if you don't see it here, make sure you did step 2 in the installation).3) Set the location of the project to: \My Documents\Visual Studio 2005\Projects\FARR Plugins\ (make sure "Create directory for solution" is checked).4) Enter a name for your plugin and press OK. For the sake of the example we'll call it SamplePlugin.5) Compile it. It should automatically be copied to FARR plugin folder and then restart FARR.6) When FARR comes up you can trigger your plugin by writing "SamplePlugin" (case sensitive!).

If all worked well, you should have your very own first plugin! Go ahead and customize for your own needs.

If something is broken, don't panic, it is rather easy to mess the whole plugin simply by deleting one line too much in the main FARR functions. Just go back step by step until you find which part you removed.

Enjoy!

Simplified SDK

As you can see from the generated template there are 3 main classes that you will need to use:

FARRCSharpPluginBase - The base class of all the plugins. Contains the metadata that describes the plugin and accepts in its constructor the main ActionList of the plugin.

ActionList - Represents a list of actions. Your plugin must have at least one ActionList. ActionList is called with a certain string that causes its ActionItems to be displayed.

ActionItem - Represents a single action on the list, part of the representation is the text that is displayed on the item but also the kind of action that happens when the user executes an item.

For further understanding I suggest to play with the various functions of the classes. You can find better examples of use in these plugins (ordered by complexity):

FARREnviormentVariables

FARRGoogleCalendar

FARRTunes

News

19/10/2008 The simplified layer of that allows a more simple and object oriented design of plugins also there is a new template that simplifies the creation of new plugins.

12/02/2008 I've uploaded a new version of SDK and all my C# plugins (FARRTunes, FARRAltTab and FARREnviormentVariables). It should resolve the following issues:

The error of "Unable to retreieve types" as described in the message-box picture below.

Now whenever there is an exception or an error you should see WHICH plugin was causing it.

Make sure you update ALL 3 plugins (GCUpdater should help you out here). Besides that anyone that used SDK to create a plugin should get latest version and recompile (specifically, FARRGoogleSuggest).

What's in the package

InstallPlugin.exe - That's the part that is for all developers. If you put this little script to the "Post Build Event" (It exists most compilers) it will auto copy your plugin to FARR directory, close FARR and reopen it. This way, whenever you build your plugin, FARR is ready to test the latest version. For those who want to fiddle with the script I also included the source in InstallPlugin.ahk. For example, in my FARRAltTab plugin the PostBuild event looks like this:

FARR CSharp SDK.chm - I compiled using NDoc a pretty referece file, some was copied was Mouser documentation and some I wrote myself. It isn't complete but it is better than nothing

FARR CSharp SDK - The main solution that holds two projects. The first one is FARRPluginRCW which is written in CLI/C++ (managed C++) and holds the actual base class for all your C# plugins. The second project is the source of FARRAltTab. Use it as your main example as you develop your plugins

If you get the following messagebox: System.Exception: Unable to load the plugin C# assembly at FARRPluginRCW.LoadPlugin()It is probably because you got an old version of FARRAltTab. It is suggested to DELETE the folder of FARRAltTab and download the latest one.

Some people get the following error using some of plugins, it can be sometimes resolved by getting the latest version. This issue should be RESOLVED if it isn't, let me know:

Currently there is a bug that limits the amount of active C# plugins to 1. If you are interested in developing a plugin, remove the FARRAltTab first from FARR plugin directory (See more info here).

Stay in touch

I will post all the updates/fixes for now to the SDK in this thread until it is deemed stable and can be merged with the main SDK.

Thanks for the .NET wrapper. I am trying to make a C# plugin but am faced with the following exceptionSystem.NullReferenceException: Object reference not set to an instance of an object. at FARRPluginRCW.LoadPlugin()

I get the exception everytime I have both my plugin and FARRAltTab installed. (Or even if I just install the FARRAltTab plugin twice). Could it be an issue with the C++ wrapper?

While we're on the topic Updated the AltTab source plugin to the current latest version (1.15) and updated the SDK. The only thing that got added is an option to send to FARR callback commands (e.g change the status bar).

Currently there is an issue with the amount of C# plugins you can put to FARR directory. The reason is that each FarrRCW.dll is .NET assembly and they are all identical in .NET sense (same identity). Basically it means that for every C# plugin there must be a unique RCW dll (and not just a copy as I thought).

Now, recompiling the RCW dll is relatively easy process (rename project & recompile) however, not everyone have C++ compilers and I am aware that many programmers out there never did anything beside C# and possibly don't have anything that can compile C++ installed. I still hope I can find a way to let anyone just change the RCW dll identity without any additional tools as the only other alternative I see now, is forcing people to recompile SDK everytime they want to develop a plugin.

In the while, if you have a plugin you want to develop, simply remove FARRAltTab from your plugins during development process so you'll always have only one C# plugin. If you want to publish it, let me know and I'll send you a unique RCW dll.

Basically each time you will compile your plugin, it will compile in the background you very own RCW version. I'll upload the latest version of SDK along with the instructions (a bit more complex then before, I'm afraid) later.

In the while, here's something little from a future add-in I am developing:

Inlcuded the current list of issues people are having with C# plugins. Please anyone who still has problems (new ones or the ones listed here) post here and tell which ones so I can assess the seriousness of each issue.