public void SetCurrency(PoolType poolType)
        {
            PoolType = poolType;

            Properties.Settings.Default.Currency = (int)poolType;
            Properties.Settings.Default.Save();

            if (!PoolDispatcherTimer.IsEnabled)
            {
                PoolDispatcherTimer.Start();
            }
        }
示例#2
0
 public override void LoaderControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     if (sender != null && Miner != null)
     {
         if (!((bool)e.NewValue))
         {
             PoolDispatcherTimer.Stop();
         }
         else
         {
             PoolDispatcherTimer.Start();
         }
     }
 }
示例#3
0
        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);
        }
示例#4
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();
        }
示例#5
0
        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();
        }