Exemplo n.º 1
0
        /// <summary>
        /// When the form closes, make sure the wallet stops refreshing and all work is saved.
        /// </summary>
        /// <param name="e"></param>
        protected async override void OnClosing(System.ComponentModel.CancelEventArgs e)
        {
            if (!skipExitWrappers)
            {
                Cursor = Cursors.WaitCursor;
                SetStatus(WalletStatus.Ready, "Exiting...");

                skipExitWrappers = true;
                e.Cancel         = true;

                Progress progess = new Progress();
                progess.Show(this);

                var tf = new TaskFactory();

                progess.SetProgress("Stopping miners", 0);
                await tf.StartNew(() => MinerManager.Exit());


                progess.SetProgress("Stopping wallet", 33);
                await tf.StartNew(() => Wallet.Exit());


                progess.SetProgress("Stopping daemon", 66);
                await tf.StartNew(() => Daemon.Exit());

                Close();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// When the form closes, make sure the wallet stops refreshing and all work is saved.
        /// </summary>
        /// <param name="e"></param>
        protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
        {
            Cursor = Cursors.Wait;
            SetStatus(WalletStatus.Ready, "Waiting for daemon to exit...");

            MinerManager.Exit();
            Wallet.Exit();
            Daemon.Exit();

            base.OnClosing(e);
        }