Difference between revisions of "PlugIn Development:GameEx Configure Function"

From Spesoft/GameEx Wiki
Jump to navigation Jump to search
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
==<span style="font-size:125%; color:darkblue;">Configure PlugIn [GameEx]</span>==
This function is called when the user configures the PlugIn from the PlugIn Manager interface.<br />Typically you would launch a configuration window from this sub. If your plugin doesn't require user configuration, you can simply leave this area empty.
This function is called when the user configures the PlugIn from the PlugIn Manager interface.
<br />
Typically you would launch a configuration window from this sub. If your plugin doesn't require user configuration, you can simply leave this area empty.
== <span class="plugin_headline_text">Parameters</span> ==
 
This substructre has no available parameters.
==Code Examples==
<br />
 
== <span class="plugin_headline_text">Code Examples</span> ==
<span style="font-size:125%; color:#003300;"><b>VB.NET syntax:</b></span>
The following code assumes that you have a <span class="plugin_return_text">Configuration</span> class with a window for setting options. <br />It's probably good practice that if you don't allow a user to configure any options, you should add a <span class="plugin_return_text">MessageBox.Show</span> command to let the user know there are no user-configurable options so they aren't deterred from enabling your plugin in the PlugIn Manager.
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:solid;">
<br />
=== <span class="plugin_text_fx">VB.NET</span> ===
<pre class="code_vb">
Public Sub Configure()
Public Sub Configure()
     Dim config As New Configuration
     Dim config As New Configuration
Line 12: Line 14:
End Sub</pre>
End Sub</pre>


<span style="font-size:125%; color:#003300;"><b>C# syntax:</b></span>
=== <span class="plugin_text_fx">C#</span> ===
<pre style="font-family:'Lucida Console', Monaco, monospace; border-color:#003300; background-color:#E0EEE0; border-style:solid;">
<pre class="code_cs">
public void Configure()
public void Configure()
{
{
Line 21: Line 23:
     }
     }
}</pre>
}</pre>
 
<br />
[[Category:PlugIn Development]]
[[Category:PlugIn Development]]

Latest revision as of 07:09, 28 April 2014

This function is called when the user configures the PlugIn from the PlugIn Manager interface.
Typically you would launch a configuration window from this sub. If your plugin doesn't require user configuration, you can simply leave this area empty.

Parameters

This substructre has no available parameters.

Code Examples

The following code assumes that you have a Configuration class with a window for setting options.
It's probably good practice that if you don't allow a user to configure any options, you should add a MessageBox.Show command to let the user know there are no user-configurable options so they aren't deterred from enabling your plugin in the PlugIn Manager.

VB.NET

Public Sub Configure()
     Dim config As New Configuration
     config.ShowDialog()
End Sub

C#

public void Configure()
{
     using(Configuration config = new Configuration())
     {
          config.ShowDialog(null);
     }
}