当前位置: 首页>>代码示例>>C#>>正文


C# vsCommandExecOption类代码示例

本文整理汇总了C#中vsCommandExecOption的典型用法代码示例。如果您正苦于以下问题:C# vsCommandExecOption类的具体用法?C# vsCommandExecOption怎么用?C# vsCommandExecOption使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


vsCommandExecOption类属于命名空间,在下文中一共展示了vsCommandExecOption类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Exec

 public void Exec(vsCommandExecOption ExecuteOption, ref object VariantIn, ref object VariantOut, ref bool Handled)
 {
     Logger.Write("Getting Sequence diagram");
     var methodName = GetMethodNameAtCursor();
     if (methodName != null)
         _client.GetRuntimeTestInformationFor(methodName);
 }
开发者ID:jeroldhaas,项目名称:ContinuousTests,代码行数:7,代码来源:GetSequenceDiagram.cs

示例2: Exec

        /// <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, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
        {
            handled = false;
            if (executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault)
            {
                if (commandName == "JsParser.AddIn.Connect.Show")
                {
                    ShowWindow();
                    handled = true;
                    return;
                }

                if (commandName == "JsParser.AddIn.Connect.Find")
                {
                    ShowWindow();
                    var wnd = EnsureWindowCreated();
                    if (wnd != null)
                    {
                        wnd.NavigationTreeView.Find();
                    }
                    handled = true;
                    return;
                }
            }
        }
开发者ID:hxhlb,项目名称:jsparser,代码行数:32,代码来源:Connect.cs

示例3: Exec

        /// <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, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
        {
            //System.Windows.Forms.MessageBox.Show("exec");

            handled = false;
            if(executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault && AcceptedCommand(commandName))
            {
                bool bForward = true;
                if(commandName == "FileSwitch2008.Connect.PrevFile")
                {
                    bForward = false;
                }

                Project fileproject = _addInInstance.DTE.ActiveDocument.ProjectItem.ContainingProject;
                string fullname =_addInInstance.DTE.ActiveDocument.FullName;

                FileGroup group = new FileGroup(fileproject, fullname.ToLower());

                string newfile = bForward ? group.Next() : group.Prev();

                _applicationObject.ItemOperations.OpenFile(newfile, Constants.vsViewKindCode);

                handled = true;
                return;
            }
        }
开发者ID:mrcharles,项目名称:FileSwitch2008,代码行数:33,代码来源:Connect.cs

示例4: Exec

        public void Exec(vsCommandExecOption ExecuteOption, ref object VariantIn, ref object VariantOut, ref bool Handled)
        {
            // Only toggle realtime mode in mighty mode
            if (!_client.IsRunning || _client.MMConfiguration.BuildExecutables.Count() == 0)
            {
                return;
            }

            var newState = _client.MMConfiguration.RealtimeFeedback ? "off" : "on";
            
            try
            {
                var ptr = GetForegroundWindow();
                var image = newState == "on" ? "maniac.png" : "mighty.png";
                var win = new TransparentImageWindow(image);
                win.Show();
                SetFocus(new HandleRef(null, ptr));
                Logger.Write("Toggling realtime mode " + newState);
                _client.MMConfiguration.OverrideRealtimeFeedback(!_client.MMConfiguration.RealtimeFeedback);
                _client.RefreshConfig();

            }
            catch(Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
开发者ID:jeroldhaas,项目名称:ContinuousTests,代码行数:27,代码来源:RealtimeToggler.cs

示例5: Exec

 public void Exec(vsCommandExecOption ExecuteOption, ref object VariantIn, ref object VariantOut, ref bool Handled)
 {
     Logger.Write("Pausing engine");
     _client.PauseEngine();
     Connect._control.Disconnecting(0);
     Connect._control.ClearList();
 }
开发者ID:jeroldhaas,项目名称:ContinuousTests,代码行数:7,代码来源:AutoTestVSStop.cs

示例6: Exec

        /// <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, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
        {
            handled = false;
            if(executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault)
            {
                if(commandName == "AutoAttachW3WP.Connect.AutoAttachW3WP")
                {
                    handled = true;
                    try
                    {

                        foreach (EnvDTE.Process process in _applicationObject.Debugger.LocalProcesses)
                        {
                            if (process.Name.ToLower().IndexOf("w3wp") > 0)
                            {
                                process.Attach();
                            }
                        }

                    }
                    catch (Exception ex)
                    {

                    }

                    return;
                }
            }
        }
开发者ID:thejoebaldwin,项目名称:auto-attach-w3wp,代码行数:36,代码来源:Connect.cs

示例7: switch

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

                case "SmartPaster.Connect.PasteAsComment":
                    smartPaster.PasteAsComment(applicationObject);
                    break;

                case "SmartPaster.Connect.PasteAsString":
                    smartPaster.PasteAsString(applicationObject);
                    break;

                case "SmartPaster.Connect.PasteAsStringBuilder":
                    smartPaster.PasteAsStringBuilder(applicationObject);
                    break;

                case "SmartPaster.Connect.PasteAsRegion":
                    smartPaster.PasteAsRegion(applicationObject);
                    break;

                default:
                    handled = false;
                    break;
            }
        }
开发者ID:johnmbaughman,项目名称:SmartPaster2010,代码行数:38,代码来源:Connect.cs

示例8: Exec

        /// <summary>Implements the Exec method of the IDTCommandTarget interface. This is called when the command is invoked.</summary>
        /// <param name='commandName'>The name of the command to execute.</param>
        /// <param name='executeOption'>Describes how the command should be run.</param>
        /// <param name='varIn'>Parameters passed from the caller to the command handler.</param>
        /// <param name='varOut'>Parameters passed from the command handler to the caller.</param>
        /// <param name='handled'>Informs the caller if the command was handled or not.</param>
        /// <seealso class='Exec' />
        public void Exec(string commandName, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
        {
            handled = false;
            if(executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault)
            {
                if (commandName == "FormatAppSettingsPlugin.Connect.FormatAppSettingsPlugin" && _applicationObject.ActiveWindow != null && _applicationObject.ActiveWindow.Caption.Equals(FILE_NAME, StringComparison.InvariantCultureIgnoreCase))
                {
                    try
                    {
                        var selection = (TextSelection)_applicationObject.ActiveDocument.Selection;
                        selection.SelectAll();
                        var formattedText = formatter.Tidy(selection.Text);
                        selection.Insert(formattedText, 1);
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show(String.Format("Error: {0}", e.Message));
                    }

                    handled = true;
                    return;
                }
                MessageBox.Show(string.Format("Please load {0} to run this plugin.",FILE_NAME));
            }
        }
开发者ID:latish,项目名称:FormatAppSettings,代码行数:32,代码来源:Connect.cs

示例9: Exec

        /// <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, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
        {
            handled = false;
            if(executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault)
            {
                if(commandName == "FormatVariableDefine.Connect.FormatVariableDefine" ||
                   commandName == "FormatVariableDefine.Connect.FormatVariableDefineRightClick")
                {
                    TextSelection select = ((TextSelection)_applicationObject.ActiveDocument.Selection);
                    int nTopLine = select.TopLine;
                    int nBottomLine = select.BottomLine;
                    bool bLastLineEmpty = select.BottomPoint.AtStartOfLine;
                    select.GotoLine(nTopLine, true);
                    select.LineDown(true, nBottomLine - nTopLine);
                    select.EndOfLine(true);

                    if (bLastLineEmpty)
                        select.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn, true);
                    string selectedCode = select.Text;
                    string outCode = CodeSmart.AlignText(selectedCode);            //对齐选中文本
                    select.Insert(outCode, (int)vsInsertFlags.vsInsertFlagsCollapseToEnd);
                    handled = true;
                    return;
                }
            }
        }
开发者ID:sun2043430,项目名称:vs2008_format_variable_define_plugin,代码行数:33,代码来源:Connect.cs

示例10: Exec

 public void Exec(vsCommandExecOption ExecuteOption, ref object VariantIn, ref object VariantOut, ref bool Handled)
 {
     object docObj = new object();
     if (Connect.LastRanTestsWindow == null)
     {
         try
         {
             Logger.Write("Starting last run tests toolbox");
             Connect.LastRanTestsWindow = _applicationObject.Windows.CreateToolWindow(_addInInstance, "ContinuousTests_ListOfRanTests", "ContinuousTests - Last Ran Tests", "{67663444-f874-401c-9e55-053bb0b5bd0b}", ref docObj);
             Connect.LastRanTestsWindow.IsFloating = false;
             Connect.LastRanTestsControl = (ContinuousTests_ListOfRanTests)docObj;
             Connect.LastRanTestsControl.SetApplication(_applicationObject);
             Connect.LastRanTestsWindow.Activate();
         }
         catch (Exception ex)
         {
             Logger.Write(ex);
         }
     }
     else
     {
         // toggle window
         if (!Connect.LastRanTestsControl.IsInFocus())
         {
             Connect.LastRanTestsWindow.Activate();
         }
         else
         {
             Connect.LastRanTestsWindow.Close();
         }
     }
     Handled = true;
 }
开发者ID:jeroldhaas,项目名称:ContinuousTests,代码行数:33,代码来源:LastTestsRanHandler.cs

示例11: Exec

        /// <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, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
        {
            handled = false;
            if(executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault)
            {
                if (commandName == _cmdPrefix + _switchCommandStr)
                {
                    SwitchWorking();
                }
                else if (commandName == _cmdPrefix + _execCommandStr)
                {
                    TextDocument doc = (TextDocument)(_applicationObject.ActiveDocument.
                           Object("TextDocument"));
                    Execute(doc.Selection.TopPoint, doc.Selection.BottomPoint, true);
                }
                else if (commandName == _cmdPrefix + _optionsCommandStr)
                {
                    SettingsForm form = new SettingsForm(AStyle);
                    form.ShowDialog();
                }

                handled = true;
                return;
            }
        }
开发者ID:Luden,项目名称:main,代码行数:32,代码来源:Connect.cs

示例12: Exec

        public virtual void Exec(string cmdName
            , vsCommandExecOption executeOption
            , ref object variantIn
            , ref object variantOut
            , ref bool handled
        )
        {
            switch (executeOption) {
            case vsCommandExecOption.vsCommandExecOptionDoDefault: {
                var x = Util.GetExcelTypeForComObject(_application.Debugger, _application.Debugger.GetType());
                var y = Util.GetExcelTypeForComObject(_application.Debugger, typeof(IDebugProperty2));

                //in future make this behave as windbg http://msdn.microsoft.com/en-us/library/ff566176(v=vs.85).aspx
                //for now lets just make it as:
                // filename address size

                string commandline = variantIn as string;

                char[] sp = new char[] { ' ', '\t' };
                string[] argv = commandline.Split(sp);

                bool bRet = ExecuteDefault(argv);

                var commandWindow = _application.Windows.Item(EnvDTE.Constants.vsWindowKindCommandWindow).Object as CommandWindow;

                commandWindow.OutputString(CommandText + " " + (bRet ? "Succeded" : "Failed") + "\r\n");
            } break;
            }
        }
开发者ID:okigan,项目名称:VsDebugHelper,代码行数:29,代码来源:WriteMem.cs

示例13: Exec

 public override void Exec(vsCommandExecOption executeOption, ref object varIn, ref object varOut)
 {
     string magicDrawPath = m_addInSettings.UMLModellerPath;
     if (magicDrawPath != string.Empty && System.IO.File.Exists(magicDrawPath) && System.IO.File.Exists(m_solutionManager.ModelFilePath) )
     {
         try
         {
             if (m_addInSettings.AutoMakeModelFileWritable)
             {
                 System.IO.FileAttributes attr = System.IO.File.GetAttributes(m_solutionManager.ModelFilePath);
                 if ((attr & System.IO.FileAttributes.ReadOnly) != 0)
                 {
                     attr -= System.IO.FileAttributes.ReadOnly;
                     System.IO.File.SetAttributes(m_solutionManager.ModelFilePath, attr);
                 }
             }
             //AddInUtils.ShowWarning("Path: " + magicDrawPath + "\nArgs: " + "\"" + m_solutionManager.ModelFilePath + "\"");
             System.Diagnostics.Process.Start(magicDrawPath, "\"" + m_solutionManager.ModelFilePath + "\"");
         }
         catch (Exception e)
         {
             AddInUtils.ShowError("An unexpected error occured while trying to launch the external UML modeling tool: " + e.Message);
         }
     }
     else
     {
         AddInUtils.ShowError("The external UML modeling tool could not be found.  Please ensure the path is correct in the Android/VS options page (Tools | Options | AndroMDA | Tools)");
     }
 }
开发者ID:siwiwit,项目名称:andromda,代码行数:29,代码来源:OpenModelCommand.cs

示例14: Exec

        /// <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, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
        {
            handled = false;
            if(executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault)
            {
                if(commandName == "LazyBot.Connect.LazyBot")
                {
                    if (_applicationObject.ActiveDocument != null && _applicationObject.ActiveDocument.Type == "Text")
                    {
                        var currentDocument = (TextDocument)_applicationObject.ActiveDocument.Object(string.Empty);
                        var selection = currentDocument.Selection;

                        var requestKeys = _botParser.GetKeys(selection);
                        var document = _botParser.GetDocument(selection);

                        var response = _botRequest.Put(requestKeys, document);

                        var message = response == "Success" ? "Your bot has been successfully saved :)" : "Something went wrong :( \n" + response;
                        MessageBox.Show(message);
                    }

                    handled = true;
                    return;
                }
            }
        }
开发者ID:joakimthun,项目名称:LazyBot,代码行数:33,代码来源:Connect.cs

示例15: Exec

        /// <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, vsCommandExecOption executeOption, ref object varIn, ref object varOut, ref bool handled)
        {
            handled = false;
            if(executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault)
            {
                if (commandName == "VsExtension.Connect.ProjectDo")
                {

            /*
                    var doc = _applicationObject.ActiveDocument;
                    var projectItem = doc.ProjectItem;
                    var project = projectItem.ContainingProject;
                    var evalProject = Microsoft.Build.Evaluation.ProjectCollection.GlobalProjectCollection.LoadProject(project.FullName);
                    var execProject = evalProject.CreateProjectInstance();

                    bool success = execProject.Build("CalledFromIde", null);

                    var window = _applicationObject.Windows.Item(Constants.vsWindowKindOutput);
                    var output = (OutputWindow)window.Object;
                    OutputWindowPane pane = output.OutputWindowPanes.Add("BuildAddin");
                    pane.OutputString(success ? "built /t:CalledFromIde" : "build failed");
            */

                    var projects = _applicationObject.ActiveSolutionProjects as System.Array;
                    if (projects.Length > 0)
                    {
                        var proj = projects.GetValue(0) as Project;
                    }

                    handled = true;
                    return;
                }
            }
        }
开发者ID:CloudMorph,项目名称:CloudMorph,代码行数:41,代码来源:Connect.cs


注:本文中的vsCommandExecOption类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。