public void Exec(EnvDTE.vsCommandExecOption ExecuteOption, ref object VariantIn, ref object VariantOut, ref bool Handled)
        {
            var runs = new List <OnDemandRun>();

            foreach (SelectedItem selectedItem in _applicationObject.SelectedItems)
            {
                try
                {
                    if (selectedItem.Project != null)
                    {
                        addItemsFor(runs, selectedItem.Project);
                    }
                    if (selectedItem.ProjectItem != null)
                    {
                        addItemFor(runs, selectedItem.ProjectItem);
                    }
                }
                catch
                {
                }
            }
            try
            {
                _peek(runs);
                if (!_manualBuild() || _buildRunner.Build(_getProjectsForBuild(runs)))
                {
                    _runTests(runs);
                }
            }
            catch (Exception ex)
            {
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///      Implements the Exec method of the IDTCommandTarget interface.
        ///      This is called when the command is invoked.
        /// </summary>
        /// <param term='commandName'>
        ///		The name of the command to execute.
        /// </param>
        /// <param term='executeOption'>
        ///		Describes how the command should be run.
        /// </param>
        /// <param term='varIn'>
        ///		Parameters passed from the caller to the command handler.
        /// </param>
        /// <param term='varOut'>
        ///		Parameters passed from the command handler to the caller.
        /// </param>
        /// <param term='handled'>
        ///		Informs the caller if the command was handled or not.
        /// </param>
        /// <seealso class='Exec' />
        public void Exec(string commandName, EnvDTE.vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
        {
            handled = false;
            if (executeOption == EnvDTE.vsCommandExecOption.vsCommandExecOptionDoDefault)
            {
                if (commandName == "IconExplorerAddIn.Connect.IconExplorerAddIn")
                {
                    handled = true;
                    try
                    {
                        iconNumber++;                         // increment icon number and replace it
                        AddCommand.ReplaceCommandInMenu(
                            addInInstance,
                            applicationObject,
                            iconNumber,
                            addInInstance.ProgID,
                            "IconExplorerAddIn",
                            "Icon Explorer: icon #" + iconNumber.ToString(),
                            "Icon will change to icon #" + Convert.ToString(iconNumber + 1) +
                            " next time you click this command.",
                            "Tools"
                            );
                    }
                    catch (System.Exception e)
                    {
                        MessageBox.Show("Exception in OnConnection: " + e.Message);
                    }

                    return;
                }
            }
        }
 /// <summary>
 /// Called by the Object Model whenever the user invokes the command.
 /// </summary>
 /// <param name="executeOption"> Execution type </param>
 /// <param name="varIn"> Input paramaters (optional) </param>
 /// <param name="varOut"> Output paramaters (optional) </param>
 public void Exec(EnvDTE.vsCommandExecOption executeOption, ref object varIn, ref object varOut)
 {
     try
     {
         AddExistingCourseDialog dialogAddExisting = new AddExistingCourseDialog(m_applicationObject);
         dialogAddExisting.ShowDialog();
     }
     catch (System.Exception)
     {
     }
 }
Exemplo n.º 4
0
        void IDTCommandTarget.Exec(
            string strCommandName,
            EnvDTE.vsCommandExecOption eoExecOption,
            ref object oIn,
            ref object oOut,
            ref bool bHandled)
        {
            System.Diagnostics.Debug.WriteLine(String.Format("Exec: {0}", strCommandName));

            _bEnabled = !_bEnabled;

            bHandled = true;
        }
Exemplo n.º 5
0
 /// <summary>
 ///      Implements the Exec method of the IDTCommandTarget interface.
 ///      This is called when the command is invoked.
 /// </summary>
 /// <param term='commandName'>
 ///		The name of the command to execute.
 /// </param>
 /// <param term='executeOption'>
 ///		Describes how the command should be run.
 /// </param>
 /// <param term='varIn'>
 ///		Parameters passed from the caller to the command handler.
 /// </param>
 /// <param term='varOut'>
 ///		Parameters passed from the command handler to the caller.
 /// </param>
 /// <param term='handled'>
 ///		Informs the caller if the command was handled or not.
 /// </param>
 /// <seealso class='Exec' />
 public void Exec(string commandName, EnvDTE.vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
 {
     Debug.WriteLine("DemoAddin: Exec() method called");
     handled = false;
     if (executeOption == EnvDTE.vsCommandExecOption.vsCommandExecOptionDoDefault)
     {
         if (commandName == "DemoAddin.Connect.DemoAddin")
         {
             handled = true;
             return;
         }
     }
 }
Exemplo n.º 6
0
 void EnvDTE.IDTCommandTarget.Exec(string CmdName, EnvDTE.vsCommandExecOption ExecuteOption, ref object VariantIn, ref object VariantOut, ref bool Handled)
 {
     try
     {
         Handled = false;
         if (ExecuteOption == vsCommandExecOption.vsCommandExecOptionDoDefault)
         {
             BIDSHelperPluginBase iExt = addins[CmdName];
             Handled = true;
             iExt.Exec();
         }
     }
     catch { }
 }
Exemplo n.º 7
0
 public void Exec(EnvDTE.vsCommandExecOption executeOption, ref object varIn, ref object varOut)
 {
     try
     {
         if (dialogRemoveCourse == null)
         {
             dialogRemoveCourse = new RemoveCourseDialog(m_applicationObject);
         }
         dialogRemoveCourse.ShowDialog();
     }
     catch (System.Exception)
     {
     }
 }
Exemplo n.º 8
0
 /// <summary>
 ///      Implements the Exec method of the IDTCommandTarget interface.
 ///      This is called when the command is invoked.
 /// </summary>
 /// <param term='commandName'>
 ///		The name of the command to execute.
 /// </param>
 /// <param term='executeOption'>
 ///		Describes how the command should be run.
 /// </param>
 /// <param term='varIn'>
 ///		Parameters passed from the caller to the command handler.
 /// </param>
 /// <param term='varOut'>
 ///		Parameters passed from the command handler to the caller.
 /// </param>
 /// <param term='handled'>
 ///		Informs the caller if the command was handled or not.
 /// </param>
 /// <seealso class='Exec' />
 public void Exec(string commandName, EnvDTE.vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
 {
     Debug.WriteLine("CodeModelWalker: Connect.Exec() called.");
     handled = false;
     if (executeOption == EnvDTE.vsCommandExecOption.vsCommandExecOptionDoDefault)
     {
         if (commandName == "CodeModelWalker.Connect.CodeModelWalker")
         {
             handled = true;
             CodeModelWalker.WalkDTE(applicationObject);
             return;
         }
     }
 }
Exemplo n.º 9
0
        /// <summary>
        ///      Implements the Exec method of the IDTCommandTarget interface.
        ///      This is called when the command is invoked.
        /// </summary>
        /// <param term='commandName'>
        ///		The name of the command to execute.
        /// </param>
        /// <param term='executeOption'>
        ///		Describes how the command should be run.
        /// </param>
        /// <param term='varIn'>
        ///		Parameters passed from the caller to the command handler.
        /// </param>
        /// <param term='varOut'>
        ///		Parameters passed from the command handler to the caller.
        /// </param>
        /// <param term='handled'>
        ///		Informs the caller if the command was handled or not.
        /// </param>
        /// <seealso class='Exec' />
        public void Exec(string commandName, EnvDTE.vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
        {
            handled = false;
            if (executeOption == EnvDTE.vsCommandExecOption.vsCommandExecOptionDoDefault)
            {
                if (commandName == "BusinessObjectJumpStart.Connect.BusinessObjectJumpStart")
                {
                    BusinessObjectCreator frmObjectCreator = new BusinessObjectCreator(applicationObject);
                    frmObjectCreator.ShowDialog();

                    handled = true;
                    return;
                }
            }
        }
        /// <summary>
        /// Called by the Object Model whenever the user invokes the command.
        /// </summary>
        /// <param name="executeOption"> Execution type </param>
        /// <param name="varIn"> Input paramaters (optional) </param>
        /// <param name="varOut"> Output paramaters (optional) </param>
        public void Exec(EnvDTE.vsCommandExecOption executeOption, ref object varIn, ref object varOut)
        {
            try
            {
                // Load the faculty Course Management homepage. Note that this will create a new browser if one
                // isn't already open, but will reuse the existing one, if one is.

                if (dialogDeleteCourse == null || dialogDeleteCourse.Visible == false)
                {
                    dialogDeleteCourse = new DeleteCourseDialog(m_applicationObject);
                }
                dialogDeleteCourse.ShowDialog();
            }
            catch (System.Exception)
            {
            }
        }
Exemplo n.º 11
0
        /// <summary>
        ///      Implements the Exec method of the IDTCommandTarget interface.
        ///      This is called when the command is invoked.
        /// </summary>
        /// <param term='commandName'>
        ///		The name of the command to execute.
        /// </param>
        /// <param term='executeOption'>
        ///		Describes how the command should be run.
        /// </param>
        /// <param term='varIn'>
        ///		Parameters passed from the caller to the command handler.
        /// </param>
        /// <param term='varOut'>
        ///		Parameters passed from the command handler to the caller.
        /// </param>
        /// <param term='handled'>
        ///		Informs the caller if the command was handled or not.
        /// </param>
        /// <seealso class='Exec' />
        public void Exec(string commandName, EnvDTE.vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
        {
            handled = false;
            if (executeOption == EnvDTE.vsCommandExecOption.vsCommandExecOptionDoDefault)
            {
                if (commandName == "SmellFinder.Connect.SmellFinder")
                {
                    handled = true;

                    //ShowToolWindow( applicationObject, addInInstance );
                    TestForm testForm = new TestForm();
                    testForm.AppObject = applicationObject;
                    testForm.Show();

                    return;
                }
            }
        }
        /// <summary>
        ///      Implements the Exec method of the IDTCommandTarget interface.
        ///      This is called when the command is invoked.
        /// </summary>
        /// <param term='commandName'>
        ///		The name of the command to execute.
        /// </param>
        /// <param term='executeOption'>
        ///		Describes how the command should be run.
        /// </param>
        /// <param term='varIn'>
        ///		Parameters passed from the caller to the command handler.
        /// </param>
        /// <param term='varOut'>
        ///		Parameters passed from the command handler to the caller.
        /// </param>
        /// <param term='handled'>
        ///		Informs the caller if the command was handled or not.
        /// </param>
        /// <seealso class='Exec' />
        public void Exec(string commandName, EnvDTE.vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
        {
            handled = false;

            IAddInCommand currentCommand = GetAddIn(commandName);

            if (currentCommand == null)
            {
                return;
            }

            try
            {
                currentCommand.Exec(executeOption, ref varIn, ref varOut);
                handled = true;
            }
            catch (System.Exception /*e*/)
            {
            }
        }
Exemplo n.º 13
0
 /// <summary>
 ///      Implements the Exec method of the IDTCommandTarget interface.
 ///      This is called when the command is invoked.
 /// </summary>
 /// <param term='commandName'>
 ///		The name of the command to execute.
 /// </param>
 /// <param term='executeOption'>
 ///		Describes how the command should be run.
 /// </param>
 /// <param term='varIn'>
 ///		Parameters passed from the caller to the command handler.
 /// </param>
 /// <param term='varOut'>
 ///		Parameters passed from the command handler to the caller.
 /// </param>
 /// <param term='handled'>
 ///		Informs the caller if the command was handled or not.
 /// </param>
 /// <seealso class='Exec' />
 public void Exec(string commandName, EnvDTE.vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
 {
     handled = false;
     if (executeOption == EnvDTE.vsCommandExecOption.vsCommandExecOptionDoDefault)
     {
         if (commandName == "AddIn.Connect.XGoF")
         {
             try
             {
                 ProgressForm prg = new ProgressForm(addInInstance.DTE.ActiveDocument.FullName);
                 prg.ShowDialog();
             }
             catch (Exception ex)
             {
                 System.Windows.Forms.MessageBox.Show(ex.ToString());
             }
             handled = true;
             return;
         }
     }
 }
Exemplo n.º 14
0
        /// <summary>
        ///      Implements the Exec method of the IDTCommandTarget interface.
        ///      This is called when the command is invoked.
        /// </summary>
        /// <param term='commandName'>
        ///		The name of the command to execute.
        /// </param>
        /// <param term='executeOption'>
        ///		Describes how the command should be run.
        /// </param>
        /// <param term='varIn'>
        ///		Parameters passed from the caller to the command handler.
        /// </param>
        /// <param term='varOut'>
        ///		Parameters passed from the command handler to the caller.
        /// </param>
        /// <param term='handled'>
        ///		Informs the caller if the command was handled or not.
        /// </param>
        /// <seealso class='Exec' />
        public void Exec(string commandName, EnvDTE.vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
        {
            handled = false;
            try
            {
                if (executeOption == EnvDTE.vsCommandExecOption.vsCommandExecOptionDoDefault)
                {
                    if (commandName == "MultiLineFindReplace.Connect.MultiLineFindReplace")
                    {
                        handled = true;
                        //add_or_replace_command(2);
                        FindReplaceForm frm = new FindReplaceForm(applicationObject);
                        frm.Show();

                        return;
                    }
                }
            }
            catch (System.Exception e)
            {
                MessageBox.Show("Exception in MultiLineFindReplace Exec(): " + e.Message);
            }
        }
Exemplo n.º 15
0
        /// <summary>
        ///      Implements the Exec method of the IDTCommandTarget interface.
        ///      This is called when the command is invoked.
        /// </summary>
        /// <param term='commandName'>
        ///		The name of the command to execute.
        /// </param>
        /// <param term='executeOption'>
        ///		Describes how the command should be run.
        /// </param>
        /// <param term='varIn'>
        ///		Parameters passed from the caller to the command handler.
        /// </param>
        /// <param term='varOut'>
        ///		Parameters passed from the command handler to the caller.
        /// </param>
        /// <param term='handled'>
        ///		Informs the caller if the command was handled or not.
        /// </param>
        /// <seealso class='Exec' />
        public void Exec(string commandName, EnvDTE.vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
        {
            handled = false;
            if (executeOption == EnvDTE.vsCommandExecOption.vsCommandExecOptionDoDefault)
            {
                if (commandName == "SynchAdd.Connect.SynchAdd")
                {
                    handled = true;

                    if (((Project)((System.Array)applicationObject.ActiveSolutionProjects).GetValue(0)).Kind !=
                        VSLangProj.PrjKind.prjKindCSharpProject)
                    {
                        System.Windows.Forms.MessageBox.Show("Sorry - C# only.");
                        return;
                    }

                    //get target class and modification requirements
                    UndoContext undoCtxt = null;
                    try{
                        TagetClassSelect tcs = new TagetClassSelect(applicationObject);
                        tcs.ShowDialog();
                        CodeClass cc = tcs.TargetClass;
                        if (cc == null)
                        {
                            return;
                        }
                        undoCtxt = applicationObject.UndoContext;
                        undoCtxt.Open("Base class synch. modifications", false);
                        CodeProcessor processor = new CodeProcessor(cc);
                        if (!processor.MakeBaseClassCompatiableWithSyncPattern())
                        {
                            if (undoCtxt.IsOpen)
                            {
                                undoCtxt.SetAborted();
                                if (undoCtxt.IsOpen)
                                {
                                    undoCtxt.Close();
                                }
                                return;
                            }
                        }
                        undoCtxt.Close();
                        undoCtxt.Open("Synch. class creation", false);
                        if (processor.CreateSynchClass())
                        {
                            System.Windows.Forms.MessageBox.Show("Synch. type created.");
                        }
                        else
                        {
                            System.Windows.Forms.MessageBox.Show("Error during synch. type creation.");
                            undoCtxt.SetAborted();
                            cc.ProjectItem.Document.Undo();
                        }
                        if (undoCtxt.IsOpen)
                        {
                            undoCtxt.Close();
                        }
                    }
                    catch (Exception e) {
                        System.Windows.Forms.MessageBox.Show("The following exception occured - (" +
                                                             e.Message + ").\nThe synchronized wrapped cannot be added at this time.");
                        if (undoCtxt != null && undoCtxt.IsOpen)
                        {
                            undoCtxt.SetAborted();
                            undoCtxt.Close();
                        }
                    }

                    return;
                }
            }
        }
Exemplo n.º 16
0
        public void Exec(string commandName,
                         EnvDTE.vsCommandExecOption executeOption,
                         ref object varIn,
                         ref object varOut,
                         ref bool handled)
        {
            try
            {
                handled = false;
                if (executeOption == EnvDTE.vsCommandExecOption.vsCommandExecOptionDoDefault)
                {
                    switch (commandName)
                    {
                    case Res.LaunchDesignerFullCommand:
                        handled = true;
                        extLoader.loadDesigner(null);
                        break;

                    case Res.LaunchLinguistFullCommand:
                        handled = true;
                        ExtLoader.loadLinguist(null);
                        break;

                    case Res.LaunchAssistantFullCommand:
                        handled = true;
                        ExtLoader.loadAssistant();
                        break;

                    case Res.ImportProFileFullCommand:
                        handled = true;
                        ExtLoader.ImportProFile();
                        break;

                    case Res.ImportPriFileFullCommand:
                        handled = true;
                        ExtLoader.ImportPriFile(HelperFunctions.GetSelectedQtProject(_applicationObject));
                        break;

                    case Res.ExportPriFileFullCommand:
                        handled = true;
                        ExtLoader.ExportPriFile();
                        break;

                    case Res.ExportProFileFullCommand:
                        handled = true;
                        ExtLoader.ExportProFile();
                        break;

                    case Res.ChangeSolutionQtVersionFullCommand:
                        QtVersionManager vManager = QtVersionManager.The();
                        if (formChangeQtVersion == null)
                        {
                            formChangeQtVersion = new FormChangeQtVersion();
                        }
                        formChangeQtVersion.UpdateContent(ChangeFor.Solution);
                        if (formChangeQtVersion.ShowDialog() == DialogResult.OK)
                        {
                            string newQtVersion = formChangeQtVersion.GetSelectedQtVersion();
                            if (newQtVersion != null)
                            {
                                string currentPlatform = null;
                                try
                                {
                                    SolutionConfiguration  config  = _applicationObject.Solution.SolutionBuild.ActiveConfiguration;
                                    SolutionConfiguration2 config2 = config as SolutionConfiguration2;
                                    currentPlatform = config2.PlatformName;
                                }
                                catch
                                {
                                }
                                if (string.IsNullOrEmpty(currentPlatform))
                                {
                                    return;
                                }

                                vManager.SetPlatform(currentPlatform);

                                foreach (Project project in HelperFunctions.ProjectsInSolution(_applicationObject))
                                {
                                    if (HelperFunctions.IsQt5Project(project))
                                    {
                                        string OldQtVersion = vManager.GetProjectQtVersion(project, currentPlatform);
                                        if (OldQtVersion == null)
                                        {
                                            OldQtVersion = vManager.GetDefaultVersion();
                                        }

                                        QtProject qtProject         = QtProject.Create(project);
                                        bool      newProjectCreated = false;
                                        qtProject.ChangeQtVersion(OldQtVersion, newQtVersion, ref newProjectCreated);
                                    }
                                }
                                vManager.SaveSolutionQtVersion(_applicationObject.Solution, newQtVersion);
                            }
                        }
                        break;

                    case Res.ProjectQtSettingsFullCommand:
                        handled = true;
                        EnvDTE.DTE dte = _applicationObject;
                        Project    pro = HelperFunctions.GetSelectedQtProject(dte);
                        if (pro != null)
                        {
                            if (formProjectQtSettings == null)
                            {
                                formProjectQtSettings = new FormProjectQtSettings();
                            }
                            formProjectQtSettings.SetProject(pro);
                            formProjectQtSettings.StartPosition = FormStartPosition.CenterParent;
                            MainWinWrapper ww = new MainWinWrapper(dte);
                            formProjectQtSettings.ShowDialog(ww);
                        }
                        else
                        {
                            MessageBox.Show(SR.GetString("NoProjectOpened"));
                        }
                        break;

                    case Res.ChangeProjectQtVersionFullCommand:
                        handled = true;
                        dte     = _applicationObject;
                        pro     = HelperFunctions.GetSelectedProject(dte);
                        if (pro != null && HelperFunctions.IsQMakeProject(pro))
                        {
                            if (formChangeQtVersion == null)
                            {
                                formChangeQtVersion = new FormChangeQtVersion();
                            }
                            formChangeQtVersion.UpdateContent(ChangeFor.Project);
                            MainWinWrapper ww = new MainWinWrapper(dte);
                            if (formChangeQtVersion.ShowDialog(ww) == DialogResult.OK)
                            {
                                string           qtVersion = formChangeQtVersion.GetSelectedQtVersion();
                                QtVersionManager vm        = QtVersionManager.The();
                                string           qtPath    = vm.GetInstallPath(qtVersion);
                                HelperFunctions.SetDebuggingEnvironment(pro, "PATH=" + qtPath + "\\bin;$(PATH)", true);
                            }
                        }
                        break;

                    case Res.VSQtOptionsFullCommand:
                        handled = true;
                        if (formQtVersions == null)
                        {
                            formQtVersions = new FormVSQtSettings();
                            formQtVersions.LoadSettings();
                        }
                        formQtVersions.StartPosition = FormStartPosition.CenterParent;
                        MainWinWrapper mww = new MainWinWrapper(_applicationObject);
                        if (formQtVersions.ShowDialog(mww) == DialogResult.OK)
                        {
                            formQtVersions.SaveSettings();
                        }
                        break;

                    case Res.CreateNewTranslationFileFullCommand:
                        handled = true;
                        pro     = HelperFunctions.GetSelectedQtProject(_applicationObject);
                        Translation.CreateNewTranslationFile(pro);
                        break;

                    case Res.CommandBarName + ".Connect.lupdate":
                        handled = true;
                        Translation.RunlUpdate(HelperFunctions.GetSelectedFiles(_applicationObject),
                                               HelperFunctions.GetSelectedQtProject(_applicationObject));
                        break;

                    case Res.CommandBarName + ".Connect.lrelease":
                        handled = true;
                        Translation.RunlRelease(HelperFunctions.GetSelectedFiles(_applicationObject));
                        break;

                    case Res.lupdateProjectFullCommand:
                        handled = true;
                        pro     = HelperFunctions.GetSelectedQtProject(Connect._applicationObject);
                        Translation.RunlUpdate(pro);
                        break;

                    case Res.lreleaseProjectFullCommand:
                        handled = true;
                        pro     = HelperFunctions.GetSelectedQtProject(Connect._applicationObject);
                        Translation.RunlRelease(pro);
                        break;

                    case Res.lupdateSolutionFullCommand:
                        handled = true;
                        Translation.RunlUpdate(Connect._applicationObject.Solution);
                        break;

                    case Res.lreleaseSolutionFullCommand:
                        handled = true;
                        Translation.RunlRelease(Connect._applicationObject.Solution);
                        break;

                    case Res.ConvertToQtFullCommand:
                    case Res.ConvertToQMakeFullCommand:
                        if (MessageBox.Show(SR.GetString("ConvertConfirmation"), SR.GetString("ConvertTitle"), MessageBoxButtons.YesNo) == DialogResult.Yes)
                        {
                            handled = true;
                            dte     = _applicationObject;
                            pro     = HelperFunctions.GetSelectedProject(dte);
                            HelperFunctions.ToggleProjectKind(pro);
                        }
                        break;
                    }
                }
            }
            catch (System.Exception e)
            {
                MessageBox.Show(e.Message + "\r\n\r\nStacktrace:\r\n" + e.StackTrace);
            }
        }
Exemplo n.º 17
0
        public void Exec(string commandName, EnvDTE.vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
        {
            handled = false;
            if (executeOption == EnvDTE.vsCommandExecOption.vsCommandExecOptionDoDefault)
            {
                try
                {
                    //start = Environment.TickCount;

                    tachyThreadCommandName = commandName;
                    switch (tachyThreadCommandName)
                    {
                    case "TachyExtension.Connect.Clear":
                        ClearTachyOutputWindowPane();
                        break;

                    case "TachyExtension.Connect.ShowAllTachyWindows":
                        ShowAllWindows(true);
                        break;

                    case "TachyExtension.Connect.HideAllTachyWindows":
                        ShowAllWindows(false);
                        break;

                    default:
                    {
                        if (DebugInfo.tachyProg == null)
                        {
                            bool canceled;
                            InitProgram(out canceled);
                            if (canceled)                                     //saving open documents was canceled
                            {
                                return;
                            }

                            ShowAllWindows(true);
                        }


                        switch (tachyThreadCommandName)
                        {
                        case "TachyExtension.Connect.Start":
                            DebugInfo.RunHidden = true;
                            if (!DebugInfo.tachyMainCommandEventIsWaiting)
                            {
                                DebugInfo.Go(DebugInfo.Command.Run);
                            }
                            else
                            {
                                SetTachyThread();
                            }
                            break;

                        case "TachyExtension.Connect.BreakAll":
                            if (!DebugInfo.debugWaitEventIsWaiting)
                            {
                                DebugInfo.Pause();
                            }
                            break;

                        case "TachyExtension.Connect.Stop":
                        case "TachyExtension.Connect.Restart":
                            if (!DebugInfo.tachyMainCommandEventIsWaiting)
                            {
                                DebugInfo.Go(DebugInfo.Command.Abort);
                            }
                            else
                            {
                                DebugInfo.tachyProg = null;
                                if (tachyThreadCommandName == "TachyExtension.Connect.Stop")
                                {
                                    ShowAllWindows(false);
                                }
                                else
                                {
                                    SetTachyThread();
                                }
                            }
                            break;

                        case "TachyExtension.Connect.StepInto":
                        case "TachyExtension.Connect.StepSelected":
                        case "TachyExtension.Connect.StepCurrentDocument":
                            DebugInfo.RunHidden = false;
                            if (DebugInfo.debugWaitEventIsWaiting)
                            {
                                DebugInfo.Go(DebugInfo.Command.Step);
                            }
                            else
                            {
                                DebugInfo.Pause();
                                SetTachyThread();
                            }
                            break;

                        case "TachyExtension.Connect.StepOver":
                            DebugInfo.RunHidden = false;
                            if (DebugInfo.debugWaitEventIsWaiting)
                            {
                                DebugInfo.Go(DebugInfo.Command.StepOver);
                            }
                            else
                            {
                                DebugInfo.Pause();
                                SetTachyThread();
                            }
                            break;

                        case "TachyExtension.Connect.RunSelected":
                            if (DebugInfo.debugWaitEventIsWaiting)
                            {
                                EvalTextSelectionWithOpenEval();
                            }
                            else
                            {
                                DebugInfo.RunHidden = true;
                                SetTachyThread();
                            }
                            break;

                        case "TachyExtension.Connect.RunCurrentDocument":
                            if (DebugInfo.debugWaitEventIsWaiting)
                            {
                                EvalDocumentWithOpenEval();
                            }
                            else
                            {
                                DebugInfo.RunHidden = true;
                                SetTachyThread();
                            }
                            break;

                        case "TachyExtension.Connect.ShowNextStatement":
                            if (DebugInfo.debugWaitEventIsWaiting)
                            {
                                DebugInfo.Go(DebugInfo.Command.ShowNextExpression);
                            }
                            else
                            {
                                MessageBox.Show("There is no expression to be evaluated.");
                            }
                            break;
                        }
                        break;
                    }
                    }
                    handled = true;
                }
                catch (System.Exception e)
                {
                    MessageBox.Show(e.Message + "\r\n\r\n" + e.InnerException + "\r\n\r\n" + e.StackTrace);
                }
            }
        }
Exemplo n.º 18
0
        /// <summary>
        ///      Implements the Exec method of the IDTCommandTarget interface.
        ///      This is called when the command is invoked.
        /// </summary>
        /// <param term='commandName'>
        ///		The name of the command to execute.
        /// </param>
        /// <param term='executeOption'>
        ///		Describes how the command should be run.
        /// </param>
        /// <param term='varIn'>
        ///		Parameters passed from the caller to the command handler.
        /// </param>
        /// <param term='varOut'>
        ///		Parameters passed from the command handler to the caller.
        /// </param>
        /// <param term='handled'>
        ///		Informs the caller if the command was handled or not.
        /// </param>
        /// <seealso class='Exec' />
        public void Exec(string commandName, EnvDTE.vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
        {
            handled = false;
            if (executeOption == EnvDTE.vsCommandExecOption.vsCommandExecOptionDoDefault)
            {
                if (commandName == "vsprj2make.Connect.CreateMake")
                {
                    // handled = true;
                    handled = CreateMakefile();
                    return;
                }

                if (commandName == "vsprj2make.Connect.GenDistUnit")
                {
                    // handled = true;
                    handled = GenerateDistUnit();
                    return;
                }

                if (commandName == "vsprj2make.Connect.GenMDFiles")
                {
                    // handled = true;
                    handled = GenerateMDcmbx();
                    return;
                }

                if (commandName == "vsprj2make.Connect.PrjxToCsproj")
                {
                    // handled = true;
                    handled = ImportMDcmbx();
                    return;
                }

                if (commandName == "vsprj2make.Connect.MonoRuntime")
                {
                    handled = true;
                    // handled = MonoRuntime();
                    return;
                }

                if (commandName == "vsprj2make.Connect.RunOnMono")
                {
                    // handled = true;
                    handled = TestInMono();
                    return;
                }

                if (commandName == "vsprj2make.Connect.Options")
                {
                    // handled = true;
                    handled = OptionsAndSettings();
                    return;
                }

                if (commandName == "vsprj2make.Connect.ExploreCurrSln")
                {
                    // handled = true;
                    handled = ExploreCurrSln();
                    return;
                }

                if (commandName == "vsprj2make.Connect.ExploreCurrDoc")
                {
                    // handled = true;
                    handled = ExploreCurrDoc();
                    return;
                }
            }
        }