コード例 #1
0
ファイル: SwdMainView.cs プロジェクト: mengjues/swd-recorder
        private void takePageScreenshotBackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker worker = sender as BackgroundWorker;

            if (worker.CancellationPending == true)
            {
                return;
            }
            presenter.TakeAndSaveScreenshot();
        }
コード例 #2
0
        private async void btnTakePageScreenshot_Click(object sender, EventArgs e)
        {
            btnTakePageScreenshot.Enabled = false;
            var oldBackground = btnTakePageScreenshot.BackColor;

            btnTakePageScreenshot.BackColor = Color.DarkGray;
            try
            {
                presenter.DisplayLoadingIndicator(true);
                await presenter.TakeAndSaveScreenshot();
            }
            finally
            {
                btnTakePageScreenshot.Enabled   = true;
                btnTakePageScreenshot.BackColor = oldBackground;
                presenter.DisplayLoadingIndicator(false);
            }
        }