public async void Command_CleanNow_Click(object sender, RoutedEventArgs e) { Worker.I.bgWorker.RunWorkerCompleted -= bgWorkerCleaner_RunWorkerCompleted; Worker.I.bgWorker.RunWorkerCompleted += bgWorkerCleaner_RunWorkerCompleted; CleanerML.Cancel = false; Worker.I.Preview = false; CleanerML.btnCloseEnable = false; CleanerML.IsCancelProcessEnabled = true; CleanerML.Run = true; CleanerML.btnPreviewCleanEnable = false; CleanerML.btnCleaningOptionsEnable = false; CleanerML.ShowCleanerDescription = false; CleanerML.ShowFrontPage = false; CleanerML.txtLoForgoundColor = "Red"; await CleanerML.Start(); // some time, user may have cancel the operation if (CleanerML.Cancel) { ProgressWorker.I.EnQ("Operation Canceled"); } Worker.I.DoWork(); // CleanerML.btnCloseEnable = true; // CleanerML.ProgressIsIndeterminate = false; // CleanerML.IsCancelProcessEnabled = false; // CleanerML.btnCleaningOptionsEnable = true; //CleanerML.ProgressText = "Done"; }
void MainWindow_Loaded(object sender, RoutedEventArgs e) { Trace.WriteLine("Application Loaded"); Pie3.Data = Home.SafeCleaningData; Command_Start_Click(); CleanerML.CommandCollapseAllClick(); BackgroundWorker bgCheckforUpdatesWorker = new BackgroundWorker(); bgCheckforUpdatesWorker.DoWork += new DoWorkEventHandler(bgCheckforUpdatesWorker_DoWork); bgCheckforUpdatesWorker.RunWorkerAsync(); // check if an update is required after being prechecked at App.xaml.cs if (StaticResources.strShredLocation == string.Empty) { if (Settings.Default.ClamWin_Update) { CommandLogic_Clam.I.LaunchUpdater(); } else // none { // then check if it requires an update at startup if (Settings.Default.ClamWin_UpdateDBAtStartup) { CommandLogic_Clam.I.LaunchUpdater(); } } } else { Shred.Command_ShowWindow_Click(); Shred.BlnIsApplicationNeedtoClose = true; Shred.ShredFilesCollection.Add(new Model_Shred() { FilePath = StaticResources.strShredLocation }); Shred.Command_ShredStart_Click(); FileAttributes attr = File.GetAttributes(StaticResources.strShredLocation); if (attr.HasFlag(FileAttributes.Directory)) { MessageBox.Show( "Shredding is done successfully for the folder: " + StaticResources.strShredLocation, "mCleaner", MessageBoxButton.OK, MessageBoxImage.Information); } else { MessageBox.Show("Shredding is done successfully for file : " + StaticResources.strShredLocation, "mCleaner", MessageBoxButton.OK, MessageBoxImage.Information); } Application.Current.Shutdown(); } ProgressWorker.I.Start(); }
void CleanerML_TreeNodeSelected(object sender, EventArgs e) { TreeNode node = sender as TreeNode; CleanerML.Run = false; CleanerML.ShowFrontPage = false; CleanerML.ShowCleanerDescription = true; rtbCleanerDetails.Document = CleanerML.BuildCleanerDetails( node.Parent != null ? (cleaner)node.Parent.Tag : (cleaner)node.Tag ); if (node.Key.Contains("duplicate_checker")) { if (DupChecker.DupplicateCollection.Count > 0) { CleanerML.Run = true; } } }
void Command_OK_Click() { this.ShowWindow = false; Thread.Sleep(25); CleanerML.Command_RestoreRegistrySelection_Click(SelectedRestoreFile.FullFilePath); }
protected void bgCheckforUpdatesWorker_DoWork(object sender, DoWorkEventArgs e) { CleanerML.CheckForUpdates(); }