using System; using System.Drawing; namespace DesktopMagicPluginAPI { /// /// The plugin class. /// public abstract class Plugin { private IPluginData application = null; /// /// Informations about the main application. /// public IPluginData Application { get => application; set { if (application is null) { application = value; } else { throw new InvalidOperationException($"You cannot set the value of the {nameof(Application)} property"); } } } /// /// Gets or sets the interval, expressed in milliseconds, at which to call the method. /// public virtual int UpdateInterval { get; set; } = 1000; /// /// Occurs once when the pugin gets activated. /// public virtual void Start() { } /// /// Occurs when the elapses. /// /// public abstract Bitmap Main(); /// /// Occurs when the window is clicked by the mouse. /// /// public virtual void OnMouseClick(Point position) { } /// /// Occurs when the mouse pointer is moved over the control. /// /// public virtual void OnMouseMove(Point position) { } } }