public override bool OnCommand() { if (null == mFiles) { Log.Info("First time fast open is run, scanning solution for files"); mFiles = new SolutionFiles(Plugin); mFiles.Refresh(); } if (null == mDialog) { mDialog = new QuickOpenDialog(mFiles); } if (mDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string name = mDialog.FileToOpen; if (name.Length > 0) { Plugin.App.DTE.ExecuteCommand("File.OpenFile", string.Format("\"{0}\"", name)); } // TODO: Each time here we could save off the window position into the registry and // use it when we open the window the next time around. } return(true); }
private void textBox1_KeyDown(object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.Escape: DialogResult = DialogResult.Cancel; this.Close(); break; case Keys.Enter: mFileToOpen = mSearchResults.Selected.fullPath; DialogResult = DialogResult.OK; this.Close(); break; case Keys.Down: mSearchResults.NextMatch(); e.Handled = true; mSelectionInfo.Text = mSearchResults.Selected.fullPath; break; case Keys.Up: mSearchResults.PrevMatch(); e.Handled = true; mSelectionInfo.Text = mSearchResults.Selected.fullPath; break; case Keys.F5: mFiles.Refresh(); break; } }
public override bool OnCommand() { if(null == mFiles) { Log.Info("First time fast open is run, scanning solution for files"); mFiles = new SolutionFiles(Plugin); mFiles.Refresh(); } if(null == mDialog) mDialog = new QuickOpenDialog(mFiles); if(mDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string name = mDialog.FileToOpen; if(name.Length > 0 ) Plugin.App.DTE.ExecuteCommand("File.OpenFile", string.Format("\"{0}\"", name)); // TODO: Each time here we could save off the window position into the registry and // use it when we open the window the next time around. } return true; }