Exemple #1
0
 public override void LoaderControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     if (sender != null && Miner != null)
     {
         if (!((bool)e.NewValue))
         {
             PoolDispatcherTimer.Stop();
         }
         else
         {
             PoolDispatcherTimer.Start();
         }
     }
 }
        protected override void OnClosing(CancelEventArgs e)
        {
            if (PoolDispatcherTimer.IsEnabled)
            {
                PoolDispatcherTimer.Stop();
            }

            if (MinerDispatcherTimer.IsEnabled)
            {
                MinerDispatcherTimer.Stop();
            }

            if (ErrorMessageTimer.IsEnabled)
            {
                ErrorMessageTimer.Stop();
            }

            SaveWindowState(MainGrid);

            base.OnClosing(e);
        }
Exemple #3
0
        public void SetMiner(Models.Miner miner)
        {
            if (Miner != null && Miner.Id == miner.Id)
            {
                return;
            }

            if (PoolDispatcherTimer.IsEnabled)
            {
                PoolDispatcherTimer.Stop();
            }

            if (BackgroundWorker.IsBusy)
            {
                BackgroundWorker.CancelAsync();
            }

            Miner = miner;

            PoolDispatcherTimer.Interval = new TimeSpan(0, 0, 0);
            PoolDispatcherTimer.Start();
        }
        public void SetPool(Pool pool)
        {
            if (Pool != null && Pool.Id == pool.Id)
            {
                return;
            }

            if (PoolDispatcherTimer.IsEnabled)
            {
                PoolDispatcherTimer.Stop();
            }

            if (BackgroundWorker.IsBusy)
            {
                BackgroundWorker.CancelAsync();
            }

            Pool = pool;

            AccountName.Content = Pool.Name;

            PoolDispatcherTimer.Interval = new TimeSpan(0, 0, 0);
            PoolDispatcherTimer.Start();
        }