private void DoLoginWork(object sender, DoWorkEventArgs e) { loginWorker.ReportProgress(0); loginWorker.ReportProgress(35); checker = new DE_IFMO_Checker(login, password); System.Threading.Thread.Sleep(1500); success = checker.GetStatus(); loginWorker.ReportProgress(100); }
public WorkspacePage(DE_IFMO_Checker checker) { InitializeComponent(); this.checker = checker; EDiaryGrid.ItemsSource = PrepareDataForDiary(); ChangeLog.ItemsSource = PrepareDataForChangeLog(); }
public WorkspacePage(DE_IFMO_Checker checker) { InitializeComponent(); logChecker = new DispatcherTimer(); logChecker.Interval = new TimeSpan(0, 0, 20); logChecker.Tick += CheckLog; logChecker.Start(); this.checker = checker; this.diaryGetter = new BackgroundWorker(); this.changelogGetter = new BackgroundWorker(); diaryGetter.WorkerReportsProgress = true; changelogGetter.WorkerReportsProgress = true; diaryGetter.DoWork += DoGetDiary; changelogGetter.DoWork += DoGetChangeLog; diaryGetter.RunWorkerCompleted += GotDiary; changelogGetter.RunWorkerCompleted += GotChangeLog; EDiaryGrid.IsEnabled = false; ChangeLog.IsEnabled = false; diaryGetter.RunWorkerAsync(); changelogGetter.RunWorkerAsync(); }