Home
Manage Your Code
Snippet: Background Worker Do Work (C#)
Title: Background Worker Do Work Language: C#
Description: This Handler is the meat and potatoes of the whole thing, executes when the RunAsync Command is executed. Views: 123
Author: Michael Webber Date Added: 3/28/2008
Copy Code  
1        private void backgroundLogin_DoWork(object sender, DoWorkEventArgs e)
2        {
3            System.Threading.Thread.Sleep(5000);
4            if (Sync == null)
5            {
6                _sync = new Synchronization();
7            }
8
9            if (Sync.Login(Username.Text, Password.Text, Anonymous.Checked))
10            {
11                DialogResult = DialogResult.OK;
12            }
13            else
14            {
15                _ErrorMessage = Sync.ErrorMessage;
16
17            }
18
19        }