Overview
Resumo do conteúdo da página
On this page:
Table of Contents | ||
---|---|---|
|
Classes in-depth
Content
Class workflow
Content
Defining a Class
Content
Calling Classes
Content
ServerMain Class methods
This section has information on some methods accessible by the ServerMain Class pre-built in any new project and how to use them in your projects. This section covers the following ServerMain class methods:
These methods can be adapted to fit various application requirements and ensure smooth transitions between different project states or dynamic configurations. To utilize methods from the ServerMain Class, follow these steps:
Navigate to Scripts → Classes → ServerMain.
Within the ServerMain class, you can create methods to execute code during the server processes.
To implement these methods, go to Scripts → CodeEditor.
In the CodeEditor, write the necessary code for the methods you've created in the ServerMain Class.
For instance, you can utilize ServerMain Class methods to reestablish communications after any project or server state change. This applies to scenarios like starting the project or switching between active and standby states in a two-project redundancy setup.
AnchorOnActivateMethod OnActivateMethod
OnActivate
Anchor | ||||
---|---|---|---|---|
|
The OnActivate
method is invoked when a project transitions from an inactive to an active state, such as during initial startup or when a standby project becomes active in a redundancy scenario.
Code Block | ||||
---|---|---|---|---|
| ||||
public void OnActivate(){ //Write your code here } |
This method executes the instructions within its code block whenever the project or server changes from inactive to active.
AnchorOnDeactivateMethod OnDeactivateMethod
OnDeactivate
Anchor | ||||
---|---|---|---|---|
|
The OnDeactivate
method is invoked when a project transitions from an active to an inactive state, either when it is stopped or during a redundancy scenario.
Code Block | ||||
---|---|---|---|---|
| ||||
public void OnDeactivate(){ //Write your code here } |
Upon each change from active to inactive, this method executes the instructions specified within its code block.
AnchorGetInitialDataSetParametersMethod GetInitialDataSetParametersMethod
GetInitialDataSetParameters
Anchor | ||||
---|---|---|---|---|
|
The GetInitialDataSetParameters method retrieves initial parameters for a DataSet, which is useful for configuring dynamic data sources with diverse initial settings. This method is called for every dataset configured in Datasets→DBs, enabling customization of each field (columns) within the Datasets→DBs, such as reading from an XML file. If the method returns "true", the configuration in the Manager is replaced with the new values obtained from the output arguments.
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
public bool GetInitialDataSetParameters(string datasetName, out string provider, out string database, out string connectionString, out string logonName, out string logonPassword, out string serverIP) { //Write your code here return true; } |
Calling a Class on HTML5 pages
How to call a class on HTML5 (@Script.Class.<ClassName>
)?
Configuration 1
Content
Configuration 2
Content
In this section...
Page Tree | ||||
---|---|---|---|---|
|