CreateTimer (TimerCallback callback)
method
Timer that will be stopped at the end of the script
Syntax
public Timer CreateTimer (TimerCallback callback)
Parameters
callback — TimerCallback
Return
Timer
Returns the timer that will be stopped at the end of the script
Example
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using PTLRuntime.NETScript;
namespace Alert
{
public class Alert : NETStrategy
{
private static System.Threading.Timer aTimer;
public override void Init()
{
aTimer = CreateTimer(OnTimedEvent,null,0,500);
}
private void OnTimedEvent(object source)
{
runAlert();
}
private void runAlert()
{
Alert("Alert");
}
}
}
Discussion
Join PTMC community to post your comments
No comments yet. Be the first.
NETColumn methods
- Alert (object[] args)
- Comment (object[] args)
- Complete ()
- ConvertUTCTimeToSelectedTimeZone (DateTime timeUTC)
- CreateTimer (TimerCallback callback, object state, int dueTime, int period)
- CreateTimer (TimerCallback callback, object state, long dueTime, long period)
- CreateTimer (TimerCallback callback, object state, TimeSpan dueTime, TimeSpan period)
- CreateTimer (TimerCallback callback, object state, uint dueTime, uint period)
- Dispose ()
- FormatValue (object value, Row row)
- GetHistoricalData (HistoricalDataRequest request)
- GetLastError ()
- GetLastErrorDescription ()
- GetValue (Row row)
- Init ()
- IsTesting ()
- OnClick (Row row)
- OnPaintChart (object sender, PaintChartEventArgs args)
- PlaySound (string fileName)
- Print (object[] args)
- QueueUserWorkItem (WaitCallback callBack)
- QueueUserWorkItem (WaitCallback callBack, object state)
- QueueUserWorkItem (WaitCallback callBack, object state, ApartmentState apartmentState)
- SendEmail (string address, string subject, string body, string filename)
- SendEmail (string address, string subject, string body)
- SendEmail (string subject, string body)
NETColumn properties
NETColumn fields