B2S.Server Sample Plugin
Sample plugin implementation for the B2S.Server
|
Switch to B2S.Server Plugin Interface Documentation |
Main class of the B2S.Server plugin.
This class must implement the IDirectPlugin interface provided by the B2SServerPluginInterface.dll.
If a plugin provides a frontend the IDirectPluginFrontend interface has to be implemented as well.
For plugins wanting to receive updates on important PinMame actions the IDirectPluginPinMame interface has to be implemented.
In addition to the implementation of the necessary interfaces, the class has to be exported for the use with MEF using the following attribute Export(typeof(B2SServerPluginInterface.IDirectPlugin)))> would be the same).
More...
Public Member Functions | |
void | PluginInit (string TableFilename, string RomName) |
Initializes the Plugin. This is the first method, which is called after the plugin has been instanciated by the B2S.Server. The IDirectPlugin interface requires the implementation of this method. More... | |
void | PluginFinish () |
Finishes the plugin. This is the last method called, before a plugin is discared. This method is also called, after a undhandled exception has occured in a plugin. PluginFinish must do all nessecary clean up work for the plugin (e.g. release resources). The IDirectPlugin interface requires the implementation of this method. More... | |
void | DataReceive (char TableElementTypeChar, int Number, int Value) |
This method is called, when new data from PinMame becomes available. The IDirectPlugin interface requires the implementation of this method. More... | |
void | PinMameRun () |
This method is called by the B2S.Server, when the Run method of PinMame gets called. The IDirectPlugin interface requires the implementation of this method. More... | |
void | PinMamePause () |
This method is called, when the property Pause of Pinmame gets set to true. The IDirectPlugin interface requires the implementation of this method. More... | |
void | PinMameContinue () |
This method is called by the B2S.Server, when the property Pause of Pinmame gets set to false. The IDirectPlugin interface requires the implementation of this method. More... | |
void | PinMameStop () |
This method is called by the B2S.Server, when the Stop method of Pinmame is called. The IDirectPlugin interface requires the implementation of this method. More... | |
void | PluginShowFrontend (Form Owner=null) |
PluginShowFrontend is called by the B2S.Server if a plugin has to show its frontend. The IDirectPluginFrontend interface requires the implementation of this method. More... | |
SamplePluginCSharp () | |
Initializes a new instance of the SamplePluginCSharp class. The class exporting the plugin interface must have a constructor without parameters. If you dont want to do any work in the constructor, the constructor can be ommitted. More... | |
Properties | |
string | Name [get] |
Gets the name of the plugin. When implmenting this property it is recommended to add the version of the plugin to the name as well. The IDirectPlugin interface requires the implementation of the property. More... | |
Main class of the B2S.Server plugin.
This class must implement the IDirectPlugin interface provided by the B2SServerPluginInterface.dll.
If a plugin provides a frontend the IDirectPluginFrontend interface has to be implemented as well.
For plugins wanting to receive updates on important PinMame actions the IDirectPluginPinMame interface has to be implemented.
In addition to the implementation of the necessary interfaces, the class has to be exported for the use with MEF using the following attribute Export(typeof(B2SServerPluginInterface.IDirectPlugin)))> would be the same).
Definition at line 33 of file SamplePluginCSharp.cs.
B2SServerSamplePluginCSharp.SamplePluginCSharp.SamplePluginCSharp | ( | ) |
Initializes a new instance of the SamplePluginCSharp class.
The class exporting the plugin interface must have a constructor without parameters. If you dont want to do any work in the constructor, the constructor can be ommitted.
Definition at line 175 of file SamplePluginCSharp.cs.
void B2SServerSamplePluginCSharp.SamplePluginCSharp.DataReceive | ( | char | TableElementTypeChar, |
int | Number, | ||
int | Value | ||
) |
This method is called, when new data from PinMame becomes available.
The IDirectPlugin interface requires the implementation of this method.
TableElementTypeChar | Char representing the table element type (S=Solenoid, W=Switch, L=Lamp, M=Mech, G=GI, E=EMTable, ?=Unknown table element). |
Number | The number of the table element. |
Value | The value of the table element. |
Definition at line 92 of file SamplePluginCSharp.cs.
void B2SServerSamplePluginCSharp.SamplePluginCSharp.PinMameContinue | ( | ) |
This method is called by the B2S.Server, when the property Pause of Pinmame gets set to false.
The IDirectPlugin interface requires the implementation of this method.
Definition at line 119 of file SamplePluginCSharp.cs.
void B2SServerSamplePluginCSharp.SamplePluginCSharp.PinMamePause | ( | ) |
This method is called, when the property Pause of Pinmame gets set to true.
The IDirectPlugin interface requires the implementation of this method.
Definition at line 112 of file SamplePluginCSharp.cs.
void B2SServerSamplePluginCSharp.SamplePluginCSharp.PinMameRun | ( | ) |
This method is called by the B2S.Server, when the Run method of PinMame gets called.
The IDirectPlugin interface requires the implementation of this method.
Definition at line 105 of file SamplePluginCSharp.cs.
void B2SServerSamplePluginCSharp.SamplePluginCSharp.PinMameStop | ( | ) |
This method is called by the B2S.Server, when the Stop method of Pinmame is called.
The IDirectPlugin interface requires the implementation of this method.
Definition at line 126 of file SamplePluginCSharp.cs.
void B2SServerSamplePluginCSharp.SamplePluginCSharp.PluginFinish | ( | ) |
Finishes the plugin.
This is the last method called, before a plugin is discared. This method is also called, after a undhandled exception has occured in a plugin.
PluginFinish must do all nessecary clean up work for the plugin (e.g. release resources).
The IDirectPlugin interface requires the implementation of this method.
Definition at line 78 of file SamplePluginCSharp.cs.
void B2SServerSamplePluginCSharp.SamplePluginCSharp.PluginInit | ( | string | TableFilename, |
string | RomName | ||
) |
Initializes the Plugin.
This is the first method, which is called after the plugin has been instanciated by the B2S.Server.
The IDirectPlugin interface requires the implementation of this method.
TableFilename | The table filename. |
RomName | Name of the rom. |
Definition at line 67 of file SamplePluginCSharp.cs.
void B2SServerSamplePluginCSharp.SamplePluginCSharp.PluginShowFrontend | ( | Form | Owner = null | ) |
PluginShowFrontend is called by the B2S.Server if a plugin has to show its frontend.
The IDirectPluginFrontend interface requires the implementation of this method.
Owner | (optional) The owner window of the frontend to be opend. Make sure that your plugin does also support null for this parameter. |
Definition at line 137 of file SamplePluginCSharp.cs.
|
get |
Gets the name of the plugin.
When implmenting this property it is recommended to add the version of the plugin to the name as well.
The IDirectPlugin interface requires the implementation of the property.
The name of the IDirectPlugin.
Definition at line 48 of file SamplePluginCSharp.cs.