C# allows code to use multiple threads and there are situations where this can be useful in an Addin. However this technique should be used with care as the host AVEVA program is not itself multiple thread safe. Thus there can be only one thread at a time which executes functions in DbLayer, CAF or other host core code.
Timer timer = new Timer();
timer.SynchronizingObject = (ISynchronizeInvoke)this;
timer.Elapsed += Timer_Elapsed;
timer.Interval = 1000;
timer.Start();
Dispatcher avevaDispatcher = Dispatcher.CurrentDispatcher;
avevaDispatcher.BeginInvoke(new Action(() => MyMethod()));
C# allows code to use multiple threads and there are situations where this can be useful in an Addin. However this technique should be used with care as the host AVEVA program is not itself multiple thread safe. Thus there can be only one thread at a time which executes functions in DbLayer, CAF or other host core code.
Timer timer = new Timer();
timer.SynchronizingObject = (ISynchronizeInvoke)this;
timer.Elapsed += Timer_Elapsed;
timer.Interval = 1000;
timer.Start();
Dispatcher avevaDispatcher = Dispatcher.CurrentDispatcher;
avevaDispatcher.BeginInvoke(new Action(() => MyMethod()));