Class EditorPlugIn
The base class for an editor plug in.
Inheritance
Implements
Inherited Members
Namespace: Gorgon.Editor.PlugIns
Assembly: Gorgon.Editor.API.dll
Syntax
public abstract class EditorPlugIn : GorgonPlugIn, IGorgonNamedObject
Constructors
| Edit this page View SourceEditorPlugIn(string)
Initializes a new instance of the EditorPlugIn class.
Declaration
protected EditorPlugIn(string description)
Parameters
Type | Name | Description |
---|---|---|
string | description | Optional description of the plugin. |
Properties
| Edit this page View SourceHostServices
Property to return the common services from the host application.
Declaration
protected IHostServices HostServices { get; set; }
Property Value
Type | Description |
---|---|
IHostServices |
Remarks
Plug in developers that implement a common plug in type based on this base type, should assign this value to allow access to the common services supplied by the host application.
If the common services are not required, then this can be null.
Plug in developers are responsible providing a mechanism for passing in the common services to the property.
See Also
| Edit this page View SourcePlugInType
Property to return the type of this plug in.
Declaration
public abstract PlugInType PlugInType { get; }
Property Value
Type | Description |
---|---|
PlugInType |
Remarks
The PlugInType returned for this property indicates the general plug in functionality.
See Also
Methods
| Edit this page View SourceGetPlugInSettings()
Function to retrieve the settings interface for the plug in.
Declaration
public ISettingsCategory GetPlugInSettings()
Returns
Type | Description |
---|---|
ISettingsCategory | The base settings view model. |
Remarks
This will return a view model that can be used to modify plug in settings on the main settings area in the application. If this method returns null, then the settings will not show in the main settings area of the application.
IsPlugInAvailable()
Function to determine if this plug in is usable or not.
Declaration
public IReadOnlyList<string> IsPlugInAvailable()
Returns
Type | Description |
---|---|
IReadOnlyList<string> | A list of string values containing information about why this plug in may not be usable at this time, or an empty array if the plug in can be used without issue. |
Remarks
Use this to determine if the plug in is able to be used in the application. If it is not available, it may be that a dependency is broken, or some other issue is keeping the plug in from working correctly.
OnGetPlugInAvailability()
Function to determine if this plug in is usable or not.
Declaration
protected virtual IReadOnlyList<string> OnGetPlugInAvailability()
Returns
Type | Description |
---|---|
IReadOnlyList<string> | A list of string values containing information about why this plug in may not be usable at this time. |
Remarks
Plug in developers should override this method if the plug in has dependencies, and those dependencies cannot be located. This can also be used by a developer to disable the plug in should it be necessary to do so.
This method should never return null, only an empty array if no problems are present.
OnGetSettings()
Function to retrieve the settings interface for this plug in.
Declaration
protected virtual ISettingsCategory OnGetSettings()
Returns
Type | Description |
---|---|
ISettingsCategory | The settings interface view model. |
Remarks
Implementors who wish to supply customizable settings for their plug ins from the main "Settings" area in the application can override this method and return a new view model based on the base ISettingsCategory type. Returning null will mean that the plug in does not have settings that can be managed externally.
Plug ins must register the view associated with their settings panel via the Register<T>(Func<Control>) method when the plug in first loaded, or else the panel will not show in the main settings area.