Skip to main content
Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 67) Base class for plug-in. Removes the need to implement all the custom loading/saving, etc. of a ModelCenter plug-in. parameterlist {"type":"element","name":"parameterlist","attributes":{"kind":"templateparam"},"children":[{"type":"element","name":"parameteritem","attributes":{},"children":[{"type":"text","text":"\n"},{"type":"element","name":"parameternamelist","attributes":{},"children":[{"type":"text","text":"\n"},{"type":"element","name":"parametername","attributes":{},"children":[{"type":"text","text":"FormClass"}]},{"type":"text","text":"\n"}]},{"type":"text","text":"\n"},{"type":"element","name":"parameterdescription","attributes":{},"children":[{"type":"text","text":"\n"},{"type":"element","name":"para","attributes":{},"children":[{"type":"text","text":"The type of form to display, which must be derived from "},{"type":"element","name":"ref","attributes":{"kindref":"compound","refid":"classPhoenix_1_1ModelCenter_1_1PlugIn_1_1ModelCenterPlugInForm"},"children":[{"type":"text","text":"ModelCenterPlugInForm"}]},{"type":"text","text":". "}]},{"type":"text","text":"\n"}]},{"type":"text","text":"\n"}]},{"type":"text","text":"\n"}]} How to create a plug-in:
Template parameters:
  • FormClass
Inherits from: Inherited by:

Members

Private attributes

Variable icon

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 73)
Type: Icon

Variable image

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 74)
Type: Image

Variable metadata

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 75)
Type: IPlugInMetaData

Variable licenseFeature

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 76)
Type: IFeature

Variable running

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 77)
Type: bool

Variable lastRunError

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 78)
Type: Exception

Variable closing

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 79)
Type: bool

Variable dtHandle

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 80)
Type: DispatchThreadHandle

Variable mainFormLock

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 81)
Type: readonly object

Properties

Property MainForm

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 90)
Gets the main form associated with this plug-in, if there is one. Return type: FormClass

Property Host

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 95)
Gets the ModelCenter host object. Return type: SModelCenterHost

Property Metadata

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 100)
Gets an instance of the metadata class associated with this plug-in. Return type: IPlugInMetaData

Property ComObject

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 111)
Gets this object as a ModelCenter plug-in instance. Return type: IComponentPlugIn

Property LicenseFeatureName

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 125)
Gets the name of the license features associated with the plug-in. Override if your form needs a license feature checked out. Return type: string

Property FeatureReleaseDate

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 139)
Gets the date when the plug-in was released. Override if your form needs a license feature checked out. Return type: string

Property RunInBackground

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 588)
Gets a value indicating whether the plug-in should be run on a background thread. Do we call Run in a background worker thread? If your derived class returns false, you can still use worker threads in your implementation of Run(). Return type: bool

Property Configuration

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 601)
Gets a configuration object that has public fields and properties which can be written during setup and read during save. Or null if there are no settings. Return type: abstract object

Property IsClosing

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 724)
Get whether the plug-in is currently being closed. Return type: bool

Property Name

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 729)
Gets the plug-in name. Return type: abstract string

Property Author

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 734)
Gets the author; null or empty for none. Return type: string

Property Description

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 745)
Gets a description of the plug-in, if any. Return type: string

Property HelpUrl

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 756)
Gets a help URL for the plug-in, if any. Return type: string

Property HelpPath

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 767)
Get a file path to local documentation, if any. Return type: string

Property Keywords

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 778)
Gets the keywords associated with the plug-in, if any. Return type: string

Property Version

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 789)
Gets the plug-in version. Return type: string

Property ToolName

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 800)
Gets the third-party tool name, or null/empty for none. Return type: string

Property ToolProvider

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 811)
Gets the third-party tool provider, or null/empty for none. Return type: string

Property Icon

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 822)
Gets the icon associated with the plug-in. May be null. Return type: Icon

Property IconImage

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/AbstractModelCenterPlugIn.cs (line 858)
Gets a 48x48 image version of the icon, or another image which will substitute. May be null. Return type: Image

Protected functions

Function AbstractModelCenterPlugIn

Constructor. Tries to find and instantiate the metadata type. Return type:

Function Dispose

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Parameters:
  • disposing: Indicates whether the method was called by Dispose or by the destructor.
Parameters:
  • bool disposing
Return type: override void

Function OnInitialized

Additional initialization after the plug-in is configured. Return type: void Reimplemented by:

Function OnConfigurationLoading

Additional setup before the configuration object has been loaded. Lets you verify the plug-in type and version or do custom deserialization. See remarks for instructions. If you want to do custom deserialization have this method return true. If you do not want to use custom deserialization, either do not access the reader or make sure not to move it past the first element and return false. If you do custom work, be sure not to read past the end of the initial node. Parameters:
  • pluginName: The name encoded in the serialized data; null if not present.
  • version: The version of the plug-in that had been saved; null if not present.
  • reader: The XML reader; can be used to do custom deserialization. It is placed at the beginning of the root node of the serialized data.
Returns: False if default deserialization should continue, true if we have handled it and it should be skipped. Parameters:
  • string pluginName
  • string version
  • XmlReader reader
Return type: bool

Function OnConfigurationLoaded

Additional setup after the configuration object has been loaded. Return type: void

Function OnConfigurationSaving

Preparatory work before the configuration object is saved. Return type: void

Function OnMainFormCreated

Event generated whenever the main form is created. Override to add additional handling. Return type: void

Function OnMainFormClosed

Event generated whenever the main form is closed. Override to add additional handling, but make sure to call the base version first Return type: void Reimplemented by:

Function OnDataCollectorCretaed

Event generated whenever a new data collector is created. Parameters:
  • dataCollector: The data collector.
Parameters:
  • IDataCollector dataCollector
Return type: void

Function OnConfigurationSerializing

Additional configuration saving for custom serialization. See remarks for instructions. If you want to do custom serialization have this method return true. If you do not want to use custom serialization, either do not access the writer or make sure not to close the root element and return false. If you do custom work, be sure not to write an open ended element. Parameters:
  • writer: The XML writer; can be used to do custom serialization.
Returns: False if default serialization should continue, true if we have handled it and it should be skipped. Parameters:
  • XmlWriter writer
Return type: bool

Private functions

Function Host_DataCollectorCreated

Connector method which hooks up the “data collector created” event. Parameters:
  • sender: The sending object.
  • e: The event args.
Parameters: Return type: void

Function construct

Parameters:
  • object modelCenter
  • object addToModel
  • object dataCollector
Return type: void IComponentPlugIn.

Function fromString

Parameters:
  • string setupString
Return type: void IComponentPlugIn.

Function onEnd

Return type: void IComponentPlugIn.

Function run_DoWork

Parameters:
  • object sender
  • DoWorkEventArgs e
Return type: void

Function _checkoutLicense

if this plug-in requires a license, make sure it gets checked out Return type: void

Function run

Return type: void IComponentPlugIn.

Function createAndShowMainForm

Return type: void

Function MainForm_Disposed

Simple method which redirects form closing events to the proper method. Parameters:
  • object sender
  • EventArgs e
Return type: void

Function show

Return type: bool IComponentPlugIn.

Function toString

Return type: string IComponentPlugIn.

Public functions

Function Run

Implement to run the plug-in. Return type: abstract void Reimplements: Run