1using System;2using PluginInterface;34namespace ExamplePlugin5{6/// <summary>7/// Plugin18/// </summary>9public class Plugin : IPlugin // <-- See how we inherited the IPlugin interface?10{11public Plugin()12{13//14// TODO: Add constructor logic here15//16}1718//Declarations of all our internal plugin variables19string myName = "ExamplePlugin";20string myDescription = "ExamplePlugin Plugin for IntelliDispatch";21string myAuthor = "OBriens Computer Service";22string myVersion = "1.0.0";23IPluginHost myHost = null;24System.Windows.Forms.UserControl myMainInterface = new ctlMain();2526/// <summary>27/// Description of the Plugin's purpose28/// </summary>29public string Description30{31get {return myDescription;}32}3334/// <summary>35/// Author of the plugin36/// </summary>37public string Author38{39get {return myAuthor;}4041}4243/// <summary>44/// Host of the plugin.45/// </summary>46public IPluginHost Host47{48//This part is currently not really implemented49/*50Here's the scoop though... You can make the host program51Implement this interface... this essentially gives you the ability52to allow plugins to access some functionality of the host program.5354Example: an mp3 player. If you had the IPluginHost interface as like:5556public interface IPluginHost57{58void Play(string FileName);59void Stop();60}6162what you would do is when the plugin is loaded in the host (this would be63in like the PluginServices.cs file in the AddPlugin() method) you would64set:65newPlugin.Host = this;6667this would give the plugin a reference to the host... now since the plugin68knows the host contains these methods, it can easily access them just like:6970this.Host.Play("C:\MyCoolMp3.mp3");7172and then they could go:7374this.Host.Stop();7576all this being from right inside the plugin! I hope you get the point. It77just means that you can indeed make your plugins able to interact with the78host program itself. Let's face it.. It would be no fun if you couldn't do this,79because otherwise all the plugin is, is just standalone functionality running80inside the host program.. (of course there are cases when you can still accomplish81many things without needing to allow the plugin to play with the host... for example82you could have an spam filter, and have each plugin be a different filter... that would83be pretty simple to make plugins for...8485so anyhow, that is what the host thingy is all aboot, eh!8687*/88get {return myHost;}89set {myHost = value;}90}9192public string Name93{94get {return myName;}95}9697public System.Windows.Forms.UserControl MainInterface98{99get {return myMainInterface;}100}101102public string Version103{104get {return myVersion;}105}106107public void Initialize()108{109//This is the first Function called by the host...110//Put anything needed to start with here first111}112113public void Dispose()114{115//Put any cleanup code in here for when the program is stopped116}117118}119}