コード例 #1
0
ファイル: WpfRes.xaml.cs プロジェクト: Leowhh/Wpftest
        private void OK_Click(object sender, RoutedEventArgs e)
        {
            string user_id  = txtUser.Text.Trim();
            string user_pwd = txtPwd.Password;
            string ip_addr  = txtIp_addr.Text.Trim();

            progressBar.IsIndeterminate = true;
            btn_OK.IsEnabled            = false;
            UserResinfoInput input = new UserResinfoInput(user_id, user_pwd, ip_addr);

            backgroundWorker.RunWorkerAsync(input);
        }
コード例 #2
0
ファイル: WpfRes.xaml.cs プロジェクト: Leowhh/Wpftest
        private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            // Get the input values.
            UserResinfoInput input = (UserResinfoInput)e.Argument;

            // Start the search for primes and wait.
            Res(input.User_id, input.User_pwd, input.Ip_addr, backgroundWorker);

            if (backgroundWorker.CancellationPending)
            {
                e.Cancel = true;
                return;
            }
        }