/// <summary>
 /// This function is the callback used to execute a command when the a menu item is clicked.
 /// See the Initialize method to see how the menu item is associated to this function using
 /// the OleMenuCommandService service and the MenuCommand class.
 /// </summary>
 private void DisplayLaunchForm(object sender, EventArgs e)
 {
     // Show a Message Box to prove we were here
     var dte = (EnvDTE80.DTE2)GetService(typeof(EnvDTE.DTE));
     LaunchForm launchForm = new LaunchForm(dte);
     if (launchForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         // The user clicked on Ok in the form, so launch the file using the sample debug engine.
         string filePath = launchForm.FilePath;
         LaunchDebugTarget(filePath);
     }
 }
        /// <summary>
        /// This function is the callback used to execute a command when the a menu item is clicked.
        /// See the Initialize method to see how the menu item is associated to this function using
        /// the OleMenuCommandService service and the MenuCommand class.
        /// </summary>
        private void DisplayLaunchForm(object sender, EventArgs e)
        {
            // Show a Message Box to prove we were here
            var        dte        = (EnvDTE80.DTE2)GetService(typeof(EnvDTE.DTE));
            LaunchForm launchForm = new LaunchForm(dte);

            if (launchForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                // The user clicked on Ok in the form, so launch the file using the sample debug engine.
                string filePath = launchForm.FilePath;
                LaunchDebugTarget(filePath);
            }
        }
Exemple #3
0
        /// <summary>
        /// Launch the project selection form for the addin. Called from the Exec method above.
        /// </summary>
        private void DisplayLaunchForm()
        {
            // Show the form.
            LaunchForm lf = new LaunchForm(_applicationObject);

            System.Windows.Forms.DialogResult result = lf.ShowDialog();
            if (result == System.Windows.Forms.DialogResult.OK)
            {
                // The user clicked on Ok in the form, so launch the file using the sample debug engine.
                LaunchDebugTarget(lf.Command, lf.CommandArguments, lf.WorkingDir);
            }
            else if (result == System.Windows.Forms.DialogResult.Yes)
            {
                AttachDebugTarget(lf.SelectedProcess);
            }
        }