private void RegisterTimer() { timer = new SmartDispatcherTimer(); timer.IsReentrant = false; timer.Interval = TimeSpan.FromSeconds(20); timer.TickTask = async() => { await CheckServiceChanged(); }; timer.Start(); }
private void RegisterLineChartTimer() { dispatcherTimer = new SmartDispatcherTimer(); dispatcherTimer.IsReentrant = false; dispatcherTimer.Interval = TimeSpan.FromSeconds(1); dispatcherTimer.TickTask = () => { UpdateGUI(); }; dispatcherTimer.Start(); }
public Strategy(string strategyName, MarketPeriod marketSeries, CurrencyPair symbol, bool?buy, bool?sell, double total) { StrategyName = strategyName; MarketSeries = marketSeries; Symbol = symbol; Buy = buy; Sell = sell; Total = total; // Timer dispatcherTimer = new SmartDispatcherTimer(); dispatcherTimer.IsReentrant = false; //Test interval dispatcherTimer.Interval = TimeSpan.FromSeconds(10); //dispatcherTimer.Interval = TimeSpan.FromSeconds((int)marketSeries); }
public void StartProcess() { // Read file in the background. cityLoader.RunWorkerAsync(); // SmartDispatched - disallows renetry. var timer = new SmartDispatcherTimer(); timer.IsReentrant = false; timer.Interval = TimeSpan.FromSeconds(updateIntervalSec); timer.TickTask = async() => { await loadLatestEarthquakes(); }; timer.Start(); // Initial load. fire and forget loadLatestEarthquakes(); }