コード例 #1
0
            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);
            }
			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;
			}