Geeks With Blogs
John Haigh's Blog

One new framework I came across recently is: Mono Addins. I have the need for a framework that will allow me to easily build extensible applications, whether they be Windows, ASP.NET or VisualWebGUI application(s). Mono Addins does a great job at fulfilling this need. I have created a Mono Addins Windows Forms Application Sample written in C#, which you can find a link to download at the end of this post.

A quick introduction from the Mono Addins project web site:

"Mono.Addins is a generic framework for creating extensible applications, and for creating libraries which extend those applications.

This framework is derived from the add-in engine used by MonoDevelop, although it has been completely rewritten and improved in many ways to make it more generic and easier to use. The MonoDevelop add-in engine was an improvement over the SharpDevelop engine, which took many ideas from the Eclipse add-in engine.

Mono.Addins has been designed to be useful for a wide range of applications: from simple applications with small extensibility needs, to complex applications (such as MonoDevelop itself) which need support for large add-in structures"

Some introductory links for Mono Addins:


For those new to Mono Addins the above introduction are great.

Mono Addin Sample Application

The sample application includes two basic Addin extensions; Regular Expression Tester and a Character Count Addin. In my next post I will provide full details of this sample.

One quick point to note is Mono Addins supports lazy loading so if you run the Sample you'll notice the Addin doesn't load and display that it has loaded to the Console until you actually click on either the Regular Expression Tester and a Character Count Addin.

Update
Due to continual downloads I have created a project on bitbucket for this Mono Addins Sample. View the project here.

Download Mono Addins Windows Forms Application Sample

 

Posted on Monday, October 5, 2009 8:50 AM Base Class Library , Mono Addins | Back to top


Comments on this post: Mono Addins Windows Forms Application Sample - Part 1

# re: Mono Addins Windows Forms Application Sample - Part 1
Requesting Gravatar...
Hi John, thanks for the sample :)

Hope you can help me out on this question: How do you unload a plugin after loading it? I really cant figure it out, hope you can help out :)

Best regards
Mads
Left by Soxiz on Nov 12, 2009 5:16 AM

# re: Mono Addins Windows Forms Application Sample - Part 1
Requesting Gravatar...
Here you go. If you email me your email address I'll send you the full code. This is another great example for a Post.

This will give you a list of Addins. I am adding them to a ListBox and then I have buttons to Enable/Disable an Addin.

Addin[] arry = AddinManager.Registry.GetAddins();

foreach (Addin item in arry)
{
this.listBox1.Items.Add(item.Id);
}

This will disable an Addin by Id:

string addinid = this.listBox1.SelectedItem.ToString();
AddinManager.Registry.DisableAddin(addinid);

This will enable an Addin by Id:

string item = this.listBox1.SelectedItem.ToString();
AddinManager.Registry.EnableAddin(item);
bool isEnabled = AddinManager.Registry.IsAddinEnabled(item);
MessageBox.Show("Addin enabled " + isEnabled.ToString());

This will determine if an Addin is enabled:

string item = this.listBox1.SelectedItem.ToString();
bool isEnabled = AddinManager.Registry.IsAddinEnabled(item);
MessageBox.Show("Addin enabled " + isEnabled.ToString() );
Left by John Haigh on Nov 12, 2009 11:00 AM

# re: Mono Addins Windows Forms Application Sample - Part 1
Requesting Gravatar...
Hi John,

I am investigating the use of Mono.Addins and found your article, "Mono Addins Windows Forms Application Sample - Part 1", to be tremendously helpful to me as a beginner.

I am now trying to modify your example to add a panel or user control as an add-in to a main form but without much luck at all I'm afraid.

So, in desperation, I thought I'd drop you a line to ask if you have some example code of how to do this?


Here's hoping,

John
Left by John Skinner on Nov 12, 2010 5:16 PM

Your comment:
 (will show your gravatar)


Copyright © John Haigh | Powered by: GeeksWithBlogs.net