Commercial & open source. Find your way forward.Compare editions
OCS NETWORKS INC / OSS

IntelliDispatch OSS MIT License

The open-source edition. An MIT-licensed core, with optional paid, licensed plugins.

Code About this workspace LicenseRead-only source browser
Public files
Settings.cs
3.1 KB · 119 linesModified Nov 6, 2026 UTC
1using System;2using PluginInterface;34namespace Settings5{6	/// <summary>7	/// Plugin18	/// </summary>9	public class Plugin : IPlugin  // <-- See how we inherited the IPlugin interface?10	{11		public Plugin()12		{13			//14			// TODO: Add constructor logic here15			//16		}17		18		//Declarations of all our internal plugin variables19		string myName = "Settings";20		string myDescription = "Settings Plugin for IntelliDispatch";21		string myAuthor = "OBriens Computer Service";22		string myVersion = "1.0.0";23		IPluginHost myHost = null;24		System.Windows.Forms.UserControl myMainInterface = new ctlMain();25		26		/// <summary>27		/// Description of the Plugin's purpose28		/// </summary>29		public string Description30		{31			get {return myDescription;}32		}3334		/// <summary>35		/// Author of the plugin36		/// </summary>37		public string Author38		{39			get	{return myAuthor;}40		41		}4243		/// <summary>44		/// Host of the plugin.45		/// </summary>46		public IPluginHost Host47		{48			//This part is currently not really implemented49			/*50			Here's the scoop though... You can make the host program51			Implement this interface... this essentially gives you the ability52			to allow plugins to access some functionality of the host program.53			54			Example: an mp3 player.  If you had the IPluginHost interface as like:55			56			public interface IPluginHost57			{58				void Play(string FileName);59				void Stop();			60			}61			62			what you would do is when the plugin is loaded in the host (this would be63			in like the PluginServices.cs file in the AddPlugin() method) you would 64			set:65				newPlugin.Host = this;66				67			this would give the plugin a reference to the host... now since the plugin68			knows the host contains these methods, it can easily access them just like:69			70				this.Host.Play("C:\MyCoolMp3.mp3");71				72			and then they could go:73			74				this.Host.Stop();75				76			all this being from right inside the plugin!  I hope you get the point.  It 77			just means that you can indeed make your plugins able to interact with the 78			host program itself.  Let's face it.. It would be no fun if you couldn't do this,79			because otherwise all the plugin is, is just standalone functionality running80			inside the host program.. (of course there are cases when you can still accomplish81			many things without needing to allow the plugin to play with the host... for example82			you could have an spam filter, and have each plugin be a different filter... that would83			be pretty simple to make plugins for...84			85			so anyhow, that is what the host thingy is all aboot, eh!	86			87			*/88			get {return myHost;}89			set	{myHost = value;}90		}9192		public string Name93		{94			get {return myName;}95		}9697		public System.Windows.Forms.UserControl MainInterface98		{99			get {return myMainInterface;}100		}101102		public string Version103		{104			get	{return myVersion;}105		}106		107		public void Initialize()108		{109			//This is the first Function called by the host...110			//Put anything needed to start with here first111		}112		113		public void Dispose()114		{115			//Put any cleanup code in here for when the program is stopped116		}117118	}119}