Exemple #1
0
 public IEnumerable<History> GetHistory()
 {
     var urlHisotry = new UrlHistoryWrapperClass();
     var enumerator = urlHisotry.GetEnumerator();
     var list = new ArrayList();
     enumerator.GetUrlHistory(list);
     List<History> list1 = new List<History>();
     foreach (STATURL item in list)
     {
         var parsedhistory = ParseHistory(item);
         if (parsedhistory != null)
             list1.Add(parsedhistory);
     }
     return list1;
 }
        /// <summary>
        /// initialize frmTrackSelector
        /// </summary>
        void InitFormClassParams()
        {
            var culture = new CultureInfo(CfgFile.Get("Lang"));
            SetCulture(culture);

            filesToDelete = new List<string>();
            foldersToDelete = new List<string>();
            regValuesToDelete = new List<string>();
            UrlHistory = new UrlHistoryWrapperClass();
            Enumerator = UrlHistory.GetEnumerator();
        }
        /// <summary>
        /// Starts scanning files
        /// </summary>
        /// <param name="fixErrorsAfterScan">Delete tracks after scanning</param>
        public void ScanFiles(bool fixErrorsAfterScan)
        {
            filesToDelete = new List<string>();
            foldersToDelete = new List<string>();
            regValuesToDelete = new List<string>();
            UrlHistory = new UrlHistoryWrapperClass();
            Enumerator = UrlHistory.GetEnumerator();

            fixAfterScan = fixErrorsAfterScan;
            if (!IsAnyNodeChecked())
            {
                // Check all nodes if none selected
                CheckAllNodes();
            }
            StartScan();
        }
Exemple #4
0
        private void LoadHistoryItems(TreeView tsHistoryMnu)
        {
            UrlHistoryWrapperClass urlHistory = new UrlHistoryWrapperClass();
            UrlHistoryWrapperClass.STATURLEnumerator enumerator = urlHistory.GetEnumerator();

            while (enumerator.MoveNext())
            {
                tsHistoryMnu.Nodes.Add(enumerator.Current.URL, enumerator.Current.Title, 19);
            }

            enumerator.Reset();
            urlHistory.Dispose();
        }
Exemple #5
0
        /// <summary>
        /// Runs Scanning process
        /// </summary>
        private void RunScan()
        {
            filesToDelete = new List<string>();
            regValuesToDelete = new List<string>();
            foldersToDelete = new List<string>();
            UrlHistory = new UrlHistoryWrapperClass();
            Enumerator = UrlHistory.GetEnumerator();
            CheckNotInstalledApps();

            tsbAnalyse.Enabled = false;
            tsbErase.Enabled = false;
            tsbCheck.Enabled = false;
            btnAnalyse.Text = rm.GetString("cancel");
            tsbAnalyse.Text = rm.GetString("scanning");

            Scanninglbl.Visible = true;
            Scanninglbl.Text = rm.GetString("scanning_tracks");
            pcbScanning.Visible = true;
            scanBackgroundWorker = new BackgroundWorker();
            scanBackgroundWorker.WorkerSupportsCancellation = true;
            scanBackgroundWorker.ProgressChanged += ProgressChanged;
            scanBackgroundWorker.DoWork += DoWork;
            scanBackgroundWorker.RunWorkerCompleted += WorkerCompleted;
            scanBackgroundWorker.RunWorkerAsync();
        }
Exemple #6
0
 /// <summary>
 /// handle click event to show options
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void optionsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     UrlHistory = new UrlHistoryWrapperClass();
     Enumerator = UrlHistory.GetEnumerator();
     frmOptions frmOptions = new frmOptions();
     frmOptions.ShowDialog();
 }
Exemple #7
0
        /// <summary>
        /// load the form
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void frmMain_Load(object sender, EventArgs e)
        {
            try
            {
                RunEraser.Enabled = false;
                culture = new CultureInfo(CfgFile.Get("Lang"));
                SetCulture(culture);

                filesToDelete = new List<string>();
                regValuesToDelete = new List<string>();
                foldersToDelete = new List<string>();
                UrlHistory = new UrlHistoryWrapperClass();
                Enumerator = UrlHistory.GetEnumerator();

                trvTracks.ExpandAll();
                trvTracks.SelectedNode = trvTracks.Nodes[0];

                CheckNotInstalledApps();

                Process[] pname = Process.GetProcessesByName("iexplore");
                if (pname.Length > 0)
                {
                    trvTracks.Nodes[1].ForeColor = Color.DarkGray;
                    for (int i = 0; i < trvTracks.Nodes[1].Nodes.Count; i++)
                    {
                        trvTracks.Nodes[1].Nodes[i].ForeColor = Color.DarkGray;
                        trvTracks.Nodes[1].Nodes[i].ImageIndex = 7;
                    }
                }

                pname = Process.GetProcessesByName("firefox");
                if (pname.Length > 0)
                {
                    trvTracks.Nodes[3].ForeColor = Color.DarkGray;
                    for (int i = 0; i < trvTracks.Nodes[3].Nodes.Count; i++)
                    {
                        trvTracks.Nodes[3].Nodes[i].ForeColor = Color.DarkGray;
                        trvTracks.Nodes[3].Nodes[i].ImageIndex = 7;
                    }
                }

                pname = Process.GetProcessesByName("chrome");
                if (pname.Length > 0)
                {
                    trvTracks.Nodes[4].ForeColor = Color.DarkGray;
                    for (int i = 0; i < trvTracks.Nodes[4].Nodes.Count; i++)
                    {
                        trvTracks.Nodes[4].Nodes[i].ForeColor = Color.DarkGray;
                        trvTracks.Nodes[4].Nodes[i].ImageIndex = 7;
                    }
                }
            }
            catch (Exception)
            {
                // ToDo: send exception details via SmartAssembly bug reporting!
            }
        }
 private void LoadRecentFiles()
 {
     try
     {
         this.Cursor = Cursors.Wait;
         List<string> recentPdfs = new List<string>();
         UrlHistoryWrapperClass urlHistory = new UrlHistoryWrapperClass();
         UrlHistoryWrapperClass.STATURLEnumerator enumerator = urlHistory.GetEnumerator();
         while (enumerator.MoveNext())
         {
             STATURL currentURL = enumerator.Current;
             string currentUrlExt = currentURL.URL.Substring(currentURL.URL.Length - 3, 3);
             string currentUrlProtocol = currentURL.URL.Substring(0, 4);
             bool isTheURLaPdf = currentUrlExt == "pdf";
             bool isTheURLProtocolaFile = currentUrlProtocol == "file";
             if (isTheURLaPdf && isTheURLProtocolaFile)
             {
                 string filename = currentURL.URL.Substring(8);
                 filename = filename.Replace("%20", " ");
                 filename = filename.Replace("/", @"\");
                 if (File.Exists(filename))
                 {
                     recentPdfs.Add(filename);
                 }
             }
             //if(enumerator.Current.)
         }
         this.RecentFiles_List.Items.Clear();
         foreach (string recentPdf in recentPdfs)
         {
             ListBoxItem listItem = new ListBoxItem();
             listItem.Content = recentPdf;
             this.RecentFiles_List.Items.Add(listItem);
         }
         this.Cursor = Cursors.Arrow;
     }
     catch (Exception fail)
     {
         throw new Exception("An error occured when trying to load recent files list.");
         this.Cursor = Cursors.Arrow;
         return;
     }
 }
Exemple #9
0
 /// <summary>
 /// Clear's IE history
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void clearIE_Click(object sender, EventArgs e)
 {
     if (DialogResult.OK ==
         MessageBox.Show(this, "Are you sure ?", "UrlHistoryDemo", MessageBoxButtons.OKCancel,
                         MessageBoxIcon.Question))
     {
         UrlHistoryWrapperClass urlHistory = new UrlHistoryWrapperClass();
         urlHistory.ClearHistory();
     }
 }