Exemplo n.º 1
0
 public void Deactivate(bool forward)
 {
     if (ScanDirectoryWorker.IsBusy)
     {
         ScanDirectoryWorker.CancelAsync();
     }
 }
Exemplo n.º 2
0
        private void BrowseLogButton_Click(object sender, EventArgs args)
        {
            using (OpenFileDialog dlg = new OpenFileDialog())
            {
                dlg.FileName = SelectedLogDirText.Text;
                dlg.Filter   = Tx.T("log selection view.file dialog.filter");
                if (!string.IsNullOrEmpty(SelectedLogDirText.Text))
                {
                    dlg.InitialDirectory = Path.GetDirectoryName(SelectedLogDirText.Text);
                }
                dlg.Title = Tx.T("log selection view.file dialog.title");

                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    if (ScanDirectoryWorker.IsBusy)
                    {
                        ScanDirectoryWorker.CancelAsync();
                    }

                    string basePath = GetBasePath(dlg.FileName);
                    SelectedLogDirText.Text = basePath;
                    try
                    {
                        SetLogBasePath(basePath);
                    }
                    catch
                    {
                        MessageBox.Show(
                            FindForm(),
                            Tx.T("msg.logpath parameter invalid", "value", basePath),
                            Tx.T("msg.title.error"),
                            MessageBoxButtons.OK,
                            MessageBoxIcon.Error);
                        ResetLogBasePath();
                        FindLogBasePath();
                        return;
                    }

                    CurrentLabel.Show();
                    SelectedLogDirText.Show();
                    FindLogsButton.Show();
                    LogDirsListView.Hide();
                    dirListMode  = false;
                    fullScanMode = false;
                    UpdateButtons();
                }
            }
        }
Exemplo n.º 3
0
        public void Activate(bool forward)
        {
            if (SharedData.Instance.FromErrorDialog ||
                SharedData.Instance.FromShortcut)
            {
                FindLogsButton.Visible = false;
            }

            UpdateButtons();

            if (!forward && fullScanMode)
            {
                if (!ScanDirectoryWorker.IsBusy)
                {
                    ScanDirectoryWorker.RunWorkerAsync();
                    MainForm.Instance.SetProgress(true, -1);
                }
            }
        }
Exemplo n.º 4
0
        private void FindLogsButton_Click(object sender, EventArgs args)
        {
            CurrentLabel.Hide();
            SelectedLogDirText.Hide();
            FindLogsButton.Hide();
            ConfigErrorLabel.Hide();
            LogDirsListView.Items.Clear();
            LogDirsListView.Show();
            dirListMode = true;
            UpdateButtons();

            if (ignoredDirectories.Count == 0)
            {
                ignoredDirectories.Add(Environment.GetFolderPath(Environment.SpecialFolder.Windows) + "\\");
                ignoredDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Adobe\\"));
                ignoredDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Common Files\\"));
                ignoredDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Google\\"));
                ignoredDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Microsoft"));
                ignoredDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Reference Assemblies\\"));
                ignoredDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Windows "));
                if (Environment.Is64BitOperatingSystem)
                {
                    ignoredDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Adobe\\"));
                    ignoredDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Common Files\\"));
                    ignoredDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Google\\"));
                    ignoredDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Microsoft"));
                    ignoredDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Reference Assemblies\\"));
                    ignoredDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "Windows "));
                }
                ignoredDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Adobe\\"));
                ignoredDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Microsoft\\"));
                ignoredDirectories.Add(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Package Cache\\"));
            }

            fullScanMode = true;
            ScanDirectoryWorker.RunWorkerAsync();
            MainForm.Instance.SetProgress(true, -1);
        }