using System.Collections.Generic; using System.Drawing; using System.Reflection; using System.Resources; namespace DelftTools.Shell.Core { /// /// Provides default functionality making it easier to implement . /// Handles Active status in activate/deactivate. /// public abstract class ApplicationPlugin : IPlugin { /// /// Gets or sets the application. /// The application. public virtual IApplication Application { get; set; } /// /// Gets the name of the plugin. /// public abstract string Name { get; } /// /// Gets the name of the plugin as displayed in the user interface. /// public abstract string DisplayName { get; } /// /// Gets the description of the plugin. /// public abstract string Description { get; } /// /// Gets the version of the plugin. /// public abstract string Version { get; } /// /// Gets a value indicating whether the plugin is active. /// true if this instance is active; otherwise, false. public virtual bool IsActive { get; protected set; } /// /// Image for displaying in gui. Default format 32x32 bitmap or scalable. /// public virtual Image Image { get { return null; } } /// /// ResourceManger of plugin. Default Properties.Resources. /// public virtual ResourceManager Resources { get; set; } // TODO: check if it is used, otherwise remove public virtual string[] DependentPluginNames { get { return new string[] {}; } } /// /// Provides information about data that can be created /// public virtual IEnumerable GetDataItemInfos() { yield break; } /// /// File importers of this plugin /// public virtual IEnumerable GetFileImporters() { yield break; } /// /// File exporters of this plugin /// public virtual IEnumerable GetFileExporters() { yield break; } /// /// Activates the plugin. /// public virtual void Activate() { IsActive = true; } /// /// Deactivates the plugin. /// public virtual void Deactivate() { IsActive = false; } // TODO: check if we can remove it public virtual IEnumerable GetPersistentAssemblies() { yield break; } } }