Click here to Skip to main content
15,885,366 members
Articles / Programming Languages / C#

Add run-time functionality to your application by providing a plug-in mechanism

Rate me:
Please Sign up or sign in to vote.
4.76/5 (43 votes)
26 May 20038 min read 163.7K   163  
Use Activator and IConfigurationSectionHandler in perfect harmony to add plugin abilities to your application
using System;
using Royo.Plugins;

namespace Royo.PluggableApp
{
	/// <summary>
	/// This class implements the IPluginContext interface
	/// to provide a context which represents the current running
	/// editor's text to plugins
	/// </summary>
	public class EditorContext:IPluginContext
	{
		private string m_CurrentText="";
		public EditorContext(string CurrentEditorText)
		{
			m_CurrentText = CurrentEditorText;
		}
		#region IPluginContext Members

		public string CurrentDocumentText
		{
			get
			{
				return m_CurrentText;
			}
			set
			{
				m_CurrentText = value;
			}
		}

		#endregion
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Israel Israel
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions