コード例 #1
0
        public QuickOutlineForm(PluginMain plugin)
        {
            this.plugin = plugin;
            InitializeComponent();

            if ((plugin.Settings as Settings).OutlineFormSize.Width > MinimumSize.Width)
            {
                Size = (plugin.Settings as Settings).OutlineFormSize;
            }

            InitTree();
            RefreshTree();
        }
コード例 #2
0
        private void LoadFilesThread()
        {
            try
            {
                cashedFiles = plugin.GetFiles(checkInProjectOnly.Checked);
                // Remove any files that are in the excluded directories
                string[] excludedDirectories = plugin.settingObject.ExcludedDirectories.Split(new char[] { ',', ';' });
                for (int i = 0; i < cashedFiles.Count;)
                {
                    bool fileRemoved = false;

                    if (excludedDirectories.Length > 0 && excludedDirectories[0] != plugin.settingObject.DefaultEmptyString)
                    {
                        foreach (string excludedDir in excludedDirectories)
                        {
                            if (cashedFiles[i].StartsWith(excludedDir))
                            {
                                fileRemoved = true;
                                break;
                            }
                        }
                    }

                    if (!fileRemoved)
                    {
                        searchManager.AddFileToSearchList(cashedFiles[i]);
                        i++;
                    }
                    else
                    {
                        cashedFiles.RemoveAt(i);
                    }
                }

                if (FindFilesForm.itemsLoadedDelegate != null)
                {
                    Invoke(FindFilesForm.itemsLoadedDelegate);
                }
            }
            catch (ThreadAbortException)
            {
                // Do nothing, we're good
                PluginMain.ClearCachedFiles();
                FindFilesForm.itemsLoadedDelegate = null;
            }
        }
コード例 #3
0
 public SearchManager(PluginMain plugin, DataGridView panel)
 {
     this.plugin    = plugin;
     pluginSettings = plugin.Settings as Settings;
     dataGridPanel  = panel;
 }
コード例 #4
0
 private void btnReload_Click(object sender, EventArgs e)
 {
     dataGridView.Rows.Clear();
     PluginMain.ClearCachedFiles();
     CreateFileList();
 }
コード例 #5
0
        public FindFilesForm(PluginMain plugin)
        {
            this.plugin    = plugin;
            pluginSettings = plugin.Settings as Settings;
            InitializeComponent();

            this.toolTipReload.SetToolTip(this.btnReload, "\nThe FindFiles plugin caches the file list the first time it opens to speed up search time.\nThis button causes the plugin to relaunch and refresh the search results.\nUse this if you added or removed files in the search directories since you first started FindFiles.");
            this.toolTipInProjectOnly.SetToolTip(this.checkInProjectOnly, "\nOnly files in the project directory will be searched. Changing this requires the file cache to be reset.");

            timer = new HiPerfTimer();

            // Restore saved settings
            if (pluginSettings.FindFilesFormSize.Width > MinimumSize.Width)
            {
                Size = pluginSettings.FindFilesFormSize;
            }
            if (pluginSettings.FileNameWidth > 0)
            {
                dataGridView.Columns[0].Width = pluginSettings.FileNameWidth;
            }
            if (pluginSettings.FilePathWidth > 0)
            {
                dataGridView.Columns[1].Width = pluginSettings.FilePathWidth;
            }

            if (PluginBase.CurrentProject == null)
            {
                checkInProjectOnly.Enabled = false;
            }
            else
            {
                checkInProjectOnly.Checked = pluginSettings.SearchInProjectOnly;
            }

            Text = "Find Files   " + pluginSettings.SearchFilter;

            nameFont = new Font("Courier New", 10, FontStyle.Bold);
            pathFont = new Font("Courier New", 8, FontStyle.Italic);

            dataGridView.Columns[0].DefaultCellStyle.Font = nameFont;
            dataGridView.Columns[1].DefaultCellStyle.Font = pathFont;

            directoryInfoText = String.Empty;
            if (pluginSettings.SearchDirectory != pluginSettings.DefaultEmptyString)
            {
                if (Directory.Exists(pluginSettings.SearchDirectory))
                {
                    directoryInfoText = pluginSettings.SearchDirectory;
                }
            }
            if ((pluginSettings.SearchProject || pluginSettings.SearchInProjectOnly) && PluginBase.CurrentProject != null)
            {
                if (directoryInfoText != String.Empty)
                {
                    directoryInfoText = "Project Folder" + "  &&  " + directoryInfoText;
                }
                else
                {
                    directoryInfoText = "Project Folder";
                }
            }

            labelSearchTime.Text = "Search Time: ...";
        }