Esempio n. 1
0
        private void SearchFiles()
        {
            state           = State.Searching;
            MainBtn.Content = "Stop";

            LogTextBox.Document.Blocks.Clear();
            LogTextBox.Document.Blocks.Add(new Paragraph(new Run("Scanning...")));

            filesToDelete.Clear();
            filesSize  = 0;
            filesCount = 0;

            FilesSizeLabel.Content  = HumanReadableByte.GetSize(0);
            FilesCountLabel.Content = "0 files";

            if (searchManager == null)
            {
                searchManager = new SearchFilesManager();

                searchManager.OnProgressChanged         += WorkerProgressChanged;
                this.searchManager.OnProgressDirChanged += this.WorkerDirProgressChanged;
                searchManager.OnFinished += SearchFilesComplete;
            }

            //// Start Seraching
            Thread thread = new Thread(searchManager.Work);

            thread.Start(context);
        }
Esempio n. 2
0
        private void SearchTextInFiles()
        {
            SearchFilesManager.SearchTextInFiles(this, new ThreadCallBackResult(ShowResult));

            if (!searchClosed)
            {
                Invoke(new ThreadCallBack(StopExecution));
            }
        }
Esempio n. 3
0
        private void clearToolStripButton_Click(object sender, EventArgs e)
        {
            Form1 form = (Form1)ParentForm;

            SearchFilesManager.ClearList(form, this);
            openFileToolStripButton.Enabled   = false;
            clearToolStripButton.Enabled      = false;
            exportListToolStripButton.Enabled = false;
            infoDirLabel.Text  = String.Empty;
            infoTextLabel.Text = String.Empty;
        }
Esempio n. 4
0
        private void searchInFilesListBox_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            Form1 form = (Form1)ParentForm;

            if (form == null)
            {
                throw new ParentFormNullException();
            }

            int selectionPosition = searchInFilesListBox.IndexFromPoint(e.X, e.Y);

            if (selectionPosition < 0)
            {
                return;
            }

            searchInFilesListBox.SelectedIndex = selectionPosition;

            String[] fileName = new String[1];
            fileName[0] = SearchFilesManager.GetFileCompletePathName(this, searchInFilesListBox.SelectedItem.ToString()); //pathBaseToolStripLabel.Text + searchInFilesListBox.SelectedItem.ToString().Substring(2);
            FileManager.OpenFile(form, form.TabIdentity, fileName);
        }
Esempio n. 5
0
 private void searchFolderButton_Click(object sender, EventArgs e)
 {
     SearchFilesManager.GetPath(this);
 }
Esempio n. 6
0
        private void openFileToolStripButton_Click(object sender, EventArgs e)
        {
            Form1 form = (Form1)ParentForm;

            SearchFilesManager.OpenSelectedFileItem(form, this);
        }
Esempio n. 7
0
 private void copyFileFullPathToolStripMenuItem_Click(object sender, EventArgs e)
 {
     SearchFilesManager.CopyFileFullPath(this);
 }
Esempio n. 8
0
        private void exportListToolStripButton_Click(object sender, EventArgs e)
        {
            Form1 form = (Form1)ParentForm;

            SearchFilesManager.ExportList(form, this);
        }