/// <summary> /// Updates the file extension and the initial directory /// </summary> private void UpdateDialogArguments() { ITabbedDocument document = Globals.CurrentDocument; if (PluginBase.CurrentProject != null) { String path = Path.GetDirectoryName(PluginBase.CurrentProject.ProjectPath); if (String.IsNullOrEmpty(this.folderComboBox.Text) || (lastProject != null && lastProject != PluginBase.CurrentProject)) { this.folderComboBox.Text = path; } lastProject = PluginBase.CurrentProject; } else if (String.IsNullOrEmpty(this.folderComboBox.Text) || !Globals.MainForm.WorkingDirectory.StartsWith(this.folderComboBox.Text)) { this.folderComboBox.Text = Globals.MainForm.WorkingDirectory; } this.folderComboBox.SelectionStart = this.folderComboBox.Text.Length; this.redirectCheckBox.CheckedChanged -= new EventHandler(this.RedirectCheckBoxCheckChanged); this.redirectCheckBox.Checked = Globals.Settings.RedirectFilesResults; this.redirectCheckBox.CheckedChanged += new EventHandler(this.RedirectCheckBoxCheckChanged); if (!this.extensionComboBox.Text.StartsWith("*.")) { this.extensionComboBox.Text = "*." + Globals.Settings.DefaultFileExtension; } if (document.IsEditable && document.SciControl.SelText.Length > 0) { this.findComboBox.Text = document.SciControl.SelText; } }
/// <summary> /// Updates the file extension and the initial directory /// </summary> private void UpdateDialogArguments() { IProject project = PluginBase.CurrentProject; ITabbedDocument document = Globals.CurrentDocument; Boolean doRefresh = lastProject != null && lastProject != project; if (project != null) { String path = Path.GetDirectoryName(project.ProjectPath); if (String.IsNullOrEmpty(this.folderComboBox.Text) || doRefresh) { this.folderComboBox.Text = path; } } else if (String.IsNullOrEmpty(this.folderComboBox.Text) || doRefresh) { this.folderComboBox.Text = Globals.MainForm.WorkingDirectory; } this.folderComboBox.SelectionStart = this.folderComboBox.Text.Length; this.redirectCheckBox.CheckedChanged -= new EventHandler(this.RedirectCheckBoxCheckChanged); this.redirectCheckBox.Checked = Globals.Settings.RedirectFilesResults; this.redirectCheckBox.CheckedChanged += new EventHandler(this.RedirectCheckBoxCheckChanged); if (!this.IsValidFileMask(this.extensionComboBox.Text) || doRefresh) { if (project != null) { String filter = project.DefaultSearchFilter; this.extensionComboBox.Text = filter; } else { String def = Globals.Settings.DefaultFileExtension; this.extensionComboBox.Text = "*." + def; } } if (document.IsEditable && document.SciControl.SelText.Length > 0) { this.findComboBox.Text = document.SciControl.SelText; } if (project != null) { lastProject = project; } }
/// <summary> /// Updates the file extension and the initial directory /// </summary> private void UpdateDialogArguments() { IProject project = PluginBase.CurrentProject; ITabbedDocument document = Globals.CurrentDocument; Boolean doRefresh = lastProject != null && lastProject != project; if (project != null) { String path = Path.GetDirectoryName(project.ProjectPath); if (String.IsNullOrEmpty(this.folderComboBox.Text) || doRefresh) { this.folderComboBox.Text = path; } } else if (String.IsNullOrEmpty(this.folderComboBox.Text) || doRefresh) { this.folderComboBox.Text = Globals.MainForm.WorkingDirectory; } this.folderComboBox.SelectionStart = this.folderComboBox.Text.Length; this.redirectCheckBox.CheckedChanged -= new EventHandler(this.RedirectCheckBoxCheckChanged); this.redirectCheckBox.Checked = Globals.Settings.RedirectFilesResults; this.redirectCheckBox.CheckedChanged += new EventHandler(this.RedirectCheckBoxCheckChanged); if (!this.IsValidFileMask(this.extensionComboBox.Text) || doRefresh) { if (project != null) { String filter = project.DefaultSearchFilter; this.extensionComboBox.Text = filter; } else { String def = Globals.Settings.DefaultFileExtension; this.extensionComboBox.Text = "*." + def; } } if (document.IsEditable && document.SciControl.SelText.Length > 0) { this.findComboBox.Text = document.SciControl.SelText; } if (project != null) lastProject = project; }