private void RegisterTimer()
 {
     timer             = new SmartDispatcherTimer();
     timer.IsReentrant = false;
     timer.Interval    = TimeSpan.FromSeconds(20);
     timer.TickTask    = async() =>
     {
         await CheckServiceChanged();
     };
     timer.Start();
 }
Esempio n. 2
0
 private void RegisterLineChartTimer()
 {
     dispatcherTimer             = new SmartDispatcherTimer();
     dispatcherTimer.IsReentrant = false;
     dispatcherTimer.Interval    = TimeSpan.FromSeconds(1);
     dispatcherTimer.TickTask    = () =>
     {
         UpdateGUI();
     };
     dispatcherTimer.Start();
 }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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();
        }