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
ContentThis 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:
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.
These methods can be adapted to fit various application requirements and ensure smooth transitions between different project states or dynamic configurations.
Anchor OnActivateMethod OnActivateMethod
OnActivate
Anchor | ||||
---|---|---|---|---|
|
The OnActivate
method is called when the project transitions from an inactive state to an active state. This can occur when a project is initially started or when a standby project becomes active in a redundancy scenario.
When implemented, this method is called every time the project/server goes from OFF (inactive) to ON (active), running the set of instructions defined within the method's code block.
Code Block | ||||
---|---|---|---|---|
| ||||
public void OnActivate(){
//Write your code here
} |
Anchor OnDeactivateMethod OnDeactivateMethod
OnDeactivate
Anchor | ||||
---|---|---|---|---|
|
The OnDeactivat
e method is called when the project transitions from an active state to an inactive state. This can happen when a project is stopped or when an active project becomes inactive in a redundancy scenario.
When implemented, this method is called each time the project/server goes from ON (active) to OFF (inactive), running all the instructions defined within the method's code block.
Code Block | ||||
---|---|---|---|---|
| ||||
public void OnDeactivate(){
//Write your code here
} |
Anchor GetInitialDataSetParametersMethod GetInitialDataSetParametersMethod
GetInitialDataSetParameters
Anchor | ||||
---|---|---|---|---|
|
The GetInitialDataSetParameters
method is used to retrieve initial parameters for a DataSet. This can be helpful in setting up dynamic data sources with varying initial configurations.
Calls the GetInitialDataSetParameters method for all Dataset→DBs configured in Edit→DataSets→DB, allowing to customize (for example, by reading from his XML file) each field (columns) of each Dataset→DB. If the return is "true", the configuration made in the Manager is overwritten with the new values (from the return arguments[out]).
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 | ||||
---|---|---|---|---|
|