ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE. Software > FARR Plugins and Aliases

FARR C# SDK and Documentation V2 (19/10/2008)

(1/11) > >>

Download link

1) Unpack the attached zip to: \My Documents\Visual Studio 2005\Projects\FARR Plugins
2) Copy FARR C# from \My Documents\Visual Studio 2005\Projects\FARR Plugins to \My Documents\Visual Studio 2005\Templates\ProjectTemplates.

Developing C# plugins for FARR is now easier than ever. To create your first plugin follow these steps:
1) Run Visual Studio 2005
2) 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.


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

* 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 problem with "FARR won't close after program launch" as described here:
* 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:

"$(SolutionDir)..\InstallPlugin.exe" "$(TargetDir)\" "C:\Program Files\FindAndRunRobot\Plugins\FARRAltTab\\"
* 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
* FARRAltTab source code - The source of the FARRAltTab plugin:
* FARRTunes source code - The source of the FARRTunes plugin:
And more!

Known issues

* If you don't see the C# plugin in the FARR plugin list after the installation then download the following update from Microsoft.
* 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.


Awesome!!!!!  :-* :-* :-* :-* :-*

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.
--- End quote ---
sounds good  :up:


By the way, even though I wrote "C#" in the post, any .NET language can be used instead with this SDK. From VB.NET to J# so truly anyone can now write a plugin!

By the way, even though I wrote "C#" in the post, any .NET language can be used instead with this SDK. From VB.NET to J# so truly anyone can now write a plugin!
--- End quote ---



Thanks for the .NET wrapper. I am trying to make a C# plugin but am faced with the following exception
System.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?




[0] Message Index

[#] Next page

Go to full version