Exemple #1
0
        private void ButtonRemoveJunks_Click(object sender, EventArgs e)
        {
            Wizzard.SelectedIndex = 8;
            if (CleanEngineClient.Instance().IsBusy())
            {
                MessageBox.Show("Scanning engine is busy. Please wait or stop engine to perform next action");
                return;
            }

            CleanEngineClient.Instance().EnableAllScanners(false);
            foreach (var scanner in files_scanner_ids)
            {
                CleanEngineClient.Instance().EnableScanner(ScannerHelpers.ScannerAsociation(scanner), true);
            }
            Wizzard.SelectedIndex = 8;
            var page       = (Wizzard.TabPages[8].Controls[0] as ScanningPanel);
            var stats_page = (Wizzard.TabPages[1].Controls[0] as StatisticsPanel);

            if (CleanEngineClient.Instance().StartEngine() &&
                page != null && stats_page != null)
            {
                page.ReinitScanProperties();
                stats_page.ReinitScanParameters();
            }
        }
Exemple #2
0
        private void ButtonStartScanMain_Click(object sender, EventArgs e)
        {
            foreach (var ctrl_check in list_checks)
            {
                //if (ctrl_check != null)
                //{
                foreach (var index in ctrl_check.ScannersToActivate.Split(';'))
                {
                    if (!String.IsNullOrEmpty(index))
                    {
                        CleanEngineClient.Instance().EnableScanner(ScannerHelpers.ScannerAsociation(Convert.ToInt32(index))
                                                                   , (ctrl_check.ImageIndex == 1) ? true : false);
                    }
                }
                //}
            }

            if (CleanEngineClient.Instance().GetActualScanners().Count < 1)
            {
                MessageBox.Show("Please select at least 1 category to scan");
                return;
            }

            Wizzard.SelectedIndex = 8;
            var page       = (Wizzard.TabPages[8].Controls[0] as ScanningPanel);
            var stats_page = (Wizzard.TabPages[1].Controls[0] as StatisticsPanel);

            if (CleanEngineClient.Instance().StartEngine() &&
                page != null && stats_page != null)
            {
                page.ReinitScanProperties();
                stats_page.ReinitScanParameters();
            }
        }
Exemple #3
0
        private void ScannerItemFound(String desc, int itemid, int scannerid)
        {
            if (!CleanEngineClient.Instance().IsBusy())
            {
                return;
            }
            ScannerToIdDelegate delegate_filescanners = new ScannerToIdDelegate(FileScannerProcessing);

            Invoke(delegate_filescanners, new object[] { scannerid, desc });

            SimpleStrinDelegate delegate_errors = new SimpleStrinDelegate(ChangeItemsNumber);

            if (scannerid != (int)CEScannerID.RECYCLEBIN_SCANNER_ID)
            {
                labelItems.Invoke(delegate_errors, new object[] { (itemid + 1).ToString(), _IsFileScanner(scannerid) });
            }
            else
            {
                labelItems.Invoke(delegate_errors, new object[] { (itemid + 1 + _current_threads_count).ToString(), _IsFileScanner(scannerid) });
            }

            SimpleStrinDelegate delegate_descr = new SimpleStrinDelegate(ChangeDescription);

            ScanningNowLabel.Invoke(delegate_descr, new object[] { desc, true });

            ItemIdToDescriptionDelegate delegate_id_desc = new ItemIdToDescriptionDelegate(_ItemIdToDescription);

            Invoke(delegate_id_desc, new object[] { itemid, desc, scannerid });
        }
Exemple #4
0
        public ScanningPanel(WizzardControl iWizzard)
        {
            InitializeComponent();

            Wizzard = iWizzard;
            FourStateActiveX.CurrentState = ItemState.eScanning;

            foreach (var item in panelScanning.Controls)
            {
                if (item is FourStateControl)
                {
                    var fourStateItem = item as FourStateControl;
                    fourStateItem.CurrentState = ItemState.eNotScanned;
                    _ProcessingItems.Add(fourStateItem);
                    CustomScannerItems.Add(new CustomScanner
                    {
                        Name       = fourStateItem.ScannerName,
                        IDs        = fourStateItem.ScannerId,
                        FoundItems = new Dictionary <IDToDescript, long>()
                    });
                }
            }

            CleanEngineClient.Instance().EnableAllScanners(true);
            CleanEngineClient.Instance().ScanningPerfomed += new CleanEngineClient.StartScan(ScanningPanel_ScanningPerfomed);
            FLCleanEngine.ManagedCleanEngine.CEScanFinished      += new FLCleanEngine.CEScannerFinished(ScannerFinishedProcessing);
            FLCleanEngine.ManagedCleanEngine.CENotifierItemFound += new FLCleanEngine.CENotificationItemFound(ScannerItemFound);
            FLCleanEngine.ManagedCleanEngine.CEScanStart         += new FLCleanEngine.CEScannerStarted(ScannerStartedProcessing);
        }
Exemple #5
0
        void tmFixingApplied_Tick(object sender, EventArgs e)
        {
            tmFixingApplied.Stop();

            var bkp_panel = (BackUpPanel)Wizzard.TabPages["BackUpPage"].Controls[0];

            if (bkp_panel != null)
            {
                bkp_panel.CreateBackUp();
            }
            var settings_panel = (SettingsPanel)Wizzard.TabPages["SettingsPage"].Controls[0];

            Dictionary <String, int> errors_fixed = new Dictionary <String, int>();
            var stat_panel = (StatisticsPanel)Wizzard.TabPages["StatisticsPage"].Controls[0];

            if (stat_panel != null)
            {
                foreach (var el in CustomScannerItems)
                {
                    errors_fixed.Add(el.IDs, 0);
                    foreach (var threat_id in el.FoundItems.Keys)
                    {
                        if (settings_panel != null && !settings_panel.GetIgnores().Contains(threat_id.Description))
                        {
                            if (CleanEngineClient.Instance().FixItem(threat_id.ID))
                            {
                                errors_fixed[el.IDs] += 1;
                            }
                        }
                    }
                }
                stat_panel.FixItems(errors_fixed);
                Wizzard.SelectedTab = Wizzard.TabPages["StatisticsPage"];
            }
        }
Exemple #6
0
 private void ButtonStop_Click(object sender, EventArgs e)
 {
     CleanEngineClient.Instance().StopEngine();
     ProgessScan.Value  = 100;
     LabelPercents.Text = 100 + "%";
     //Wizzard.SelectedIndex = 1;
     ScanningFinished(true);
 }
 void _bw_DoWork(object sender, DoWorkEventArgs e)
 {
     try
     {
         CleanEngineClient.Instance().CompactHives();
     }
     catch
     { }
 }
 void _bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (!CleanEngineClient.Instance().IsBusy())
     {
         Wizzard.SelectedIndex = 0;
     }
     else
     {
         Wizzard.SelectedIndex = 8;
     }
 }
Exemple #9
0
 void _bw_DoWork(object sender, DoWorkEventArgs e)
 {
     try
     {
         if (CleanEngineClient.Instance().LoadHivesInfo(Path.Combine(Environment.CurrentDirectory, "DefragFiles")))
         {
             CleanEngineClient.Instance().AnalizeHives();
         }
     }
     catch { }
 }
Exemple #10
0
        private void FixItems()
        {
            var bkp_panel = (BackUpPanel)Wizzard.TabPages["BackUpPage"].Controls[0];

            if (bkp_panel != null)
            {
                bkp_panel.CreateBackUp();
            }

            var settings_panel = (SettingsPanel)Wizzard.TabPages["SettingsPage"].Controls[0];
            Dictionary <String, int> errors_fixed = new Dictionary <String, int>();

            if (settings_panel != null)
            {
                foreach (TreeNode node in TreeViewErrors.Nodes)
                {
                    if (node.Nodes.Count > 0)
                    {
                        if (!node.Checked)
                        {
                            continue;
                        }
                        errors_fixed.Add((String)node.Tag, 0);
                        foreach (TreeNode item in node.Nodes)
                        {
                            if (item.Checked == true && !settings_panel.GetIgnores().Contains(item.Text))
                            {
                                var tag = (KeyValuePair <IDToDescript, long>)item.Tag;
                                if (CleanEngineClient.Instance().FixItem(tag.Key.ID))
                                {
                                    errors_fixed[(String)node.Tag] += 1;
                                }
                            }
                        }
                    }
                }
            }
            var stat_panel = (StatisticsPanel)Wizzard.TabPages["StatisticsPage"].Controls[0];

            if (stat_panel != null)
            {
                stat_panel.FixItems(errors_fixed);
                Program.CurrentState = ApplicationState.eNone;
                Wizzard.SelectedTab  = Wizzard.TabPages["StatisticsPage"];
            }
        }
Exemple #11
0
        public StartScanPanel(WizzardControl iWizzard)
        {
            InitializeComponent();

            Wizzard = iWizzard;
            this.ButtonStartScanMain.MouseHover += new System.EventHandler(ButtonStartScanMain_MouseHover);
            this.ButtonStartScanMain.MouseLeave += new System.EventHandler(ButtonStartScanMain_MouseLeave);

            RegistryKey key = Registry.CurrentUser.OpenSubKey(Program.ApplicationOptions);

            if (key != null)
            {
                String date = String.Empty;
                try
                {
                    date = key.GetValue("LastScan").ToString();
                }
                catch { date = String.Empty; }
                var labels_parts = labelLastScanPerformed.Text.Split(' ');
                if ((labels_parts.Count() > 1) && !String.IsNullOrEmpty(date))
                {
                    labelLastScanPerformed.Text            = "";
                    labels_parts[labels_parts.Count() - 1] = date;
                    foreach (var word in labels_parts)
                    {
                        labelLastScanPerformed.Text += (" " + word);
                    }
                }
            }
            list_checks.AddRange(new CustomFrontLineCheckButton[] { CheckButtonAppErrors,
                                                                    CheckButtonWinErrors,
                                                                    CheckButtonOCXErrors,
                                                                    CheckButtonRegErrors,
                                                                    CheckButtonRecycleBin,
                                                                    CheckButtonTempInternet,
                                                                    CheckButtonDLLErrors,
                                                                    CheckButtonTempFiles,
                                                                    CheckButtonInvalidFiles });
            CleanEngineClient.Instance().ScanningPerfomed += new CleanEngineClient.StartScan(StartScanPanel_ScanningPerfomed);
            if (ApplicationSettings.NeedScan)
            {
                tmScan.Tick -= tmScan_Tick;
                tmScan.Tick += new EventHandler(tmScan_Tick);
                tmScan.Start();
            }
        }
Exemple #12
0
        private void ScannerFinishedProcessing(int id)
        {
            if (ProgessScan.Value + 100 / CleanEngineClient.Instance().GetActualScanners().Count < 100)
            {
                ProgessScan.MarqueeUpdate();
                ProgessScan.Value += 100 / CleanEngineClient.Instance().GetActualScanners().Count;
            }
            else
            {
                ProgessScan.Value = 100;
                ScanningFinishedDelegate delegate_sc_finished = new ScanningFinishedDelegate(ScanningFinished);
                this.Invoke(delegate_sc_finished, new object[] { false });
            }
            ScannerChangedDelegate delegate_percents = new ScannerChangedDelegate(IncrementPercents);

            LabelPercents.Invoke(delegate_percents, new object[] { ProgessScan.Value.ToString(), id });
        }
        void CustomFrontLineCheckButton_Click(object sender, EventArgs e)
        {
            CheckButtonFace(sender);
            var btn = (CustomFrontLineCheckButton)sender;

            if (String.IsNullOrEmpty(btn.ScannersToActivate))
            {
                return;
            }

            foreach (var index in btn.ScannersToActivate.Split(';'))
            {
                if (String.IsNullOrEmpty(index))
                {
                    continue;
                }
                CleanEngineClient.Instance().EnableScanner(ScannerHelpers.ScannerAsociation(Convert.ToInt32(index))
                                                           , (btn.ImageIndex == 1) ? true : false);
            }
        }
Exemple #14
0
        void ScanningPanel_ScanningPerfomed()
        {
            foreach (var ctrl in _ProcessingItems)
            {
                ctrl.CurrentState = ItemState.eScanNotPerformed;
            }

            foreach (var id in CleanEngineClient.Instance().GetActualScanners())
            {
                foreach (var item in _ProcessingItems)
                {
                    var ids = item.ScannerId.Split(';');
                    if (_ContainID((int)id, ids))
                    {
                        item.CurrentState = ItemState.eNotScanned;
                        break;
                    }
                }
            }
        }
Exemple #15
0
 private void ButtonPause_Click(object sender, EventArgs e)
 {
     CleanEngineClient.Instance().PauseEngine(true);
     ButtonPause.Visible  = false;
     ButtonResume.Visible = true;
 }