Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info
iconfalse

Download the Solution Example here: ScriptTasksAndClasses.dbsln


  • Solution Name: Scripts Tasks And Classes
  • Software Version: v10
  • Keywords: Scripts. Classes. Tasks.

Summary

Tasks and Classes are used to solve problems in your desired solution. This solution example shows the use of Tasks and Classeshow to use them in multiple ways within the software product environment.


Technical Information

All the programming in the platform consists of The platform is fully programmed using managed C# or Visual Basic 100% managed code designed to run in code within the Microsoft .NET framework. These languages are used to create Scripts that run periodically or when specified events occur.Tasks are program units, enabling the creation of scripts that execute on a schedule or in response to specific events. Tasks, written in VB.NET or C#, that execute either when a trigger event occurs or periodically at specified intervals. The platform includes the following built-in Tasks:

ServerStartup, ServerShutdown, ClientStartup, ClientShutdown. To configure Tasks, go to  Scripts / Tasks.

Classes let you create a repository of are triggered either by specific events or at designated intervals, and can be configured under Scripts / Tasks. Additionally, Classes provide a repository for reusable class libraries, methods, and functions that you can use across the application. You can call them from , which can be accessed by Tasks, other Classes, and displays (code behind).or displays, streamlining application-wide functionality.

This solution example demonstrates five different ways to access scripts or tasks.
The first one shows a message box popup using a script.

Image Added

The button above runs a script in the CodeBehind. The code in the CodeBehind uses the @Script.Class method to call a class that was previously set up. The code snippet used in the CodeBehind can be found below:

Code Block
languagevb
Public Sub MouseLeftButtonDown1(ByVal sender As Object, ByVal e As System.Windows.Input.MouseButtonEventArgs)
	' You can find the logic related to "MyClass" on Scripts ? Classes ? MyClass
	@Script.Class.MyClass.Hello(@Tag.sayit)
End Sub


For the second button, it calls a class through expressions written in VB.NET.

Image Added

The way it works is through “Run Expression” in the Action tab in the Dynamics window, and it calls the function in a similar way as before:

Code Block
languagevb
Script.Class.MyClass.Hello2(Tag.sayit)

The third button works through the use of a trigger.

Image Added

This trigger is configured in the Tasks page to call a method, and through this intermediary, the counter is incremented by one when the task is called.

The fourth panel does not have a button. However, it uses a trigger that is triggered every second. It is also set up in the Tasks page.

Image Added

Lastly, the Counter (Class) panel also works as a counter, but its implementation is done through a class that passes the current value as a parameter.

Image Added

After receiving the parameter, it increments the tag and updates the display.

Along with that information, the solution example also contains information boxes that can lead you to the exact parts of the code where they get triggered. These information boxes can be found in each individual panel, and clicking on them will provide you with the desired informationThe software platform comes with the following built-in classes: ServerMain and ClientMain. To configure classes go to Scripts / Classes.


Reference

→ See Scripts, Tasks and Classes for more information.


In this section:

Page Tree
root@parent
spacesV10