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


C# VisualStudio.VSConstants类代码示例

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


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

示例1: VerifyConvert

 private void VerifyConvert(VSConstants.VSStd97CmdID cmd, KeyInput ki, EditCommandKind kind)
 {
     EditCommand command;
     Assert.True(OleCommandUtil.TryConvert(VSConstants.GUID_VSStandardCommandSet97, (uint)cmd, IntPtr.Zero, VimKeyModifiers.None, out command));
     Assert.Equal(ki, command.KeyInput);
     Assert.Equal(kind, command.EditCommandKind);
 }
开发者ID:Yzzl,项目名称:VsVim,代码行数:7,代码来源:OleCommandUtilTest.cs

示例2: IsDebugIgnore

        internal static bool IsDebugIgnore(VSConstants.VSStd2KCmdID commandId)
        {
            switch (commandId)
            {
                // A lot of my debugging is essentially figuring out which command is messing up normal mode.
                // Unfortunately VS likes to throw a lot of commands all of the time.  I list them here so they don't
                // come through my default mode where I can then set a break point
                case VSConstants.VSStd2KCmdID.SolutionPlatform:
                case VSConstants.VSStd2KCmdID.FILESYSTEMEDITOR:
                case VSConstants.VSStd2KCmdID.REGISTRYEDITOR:
                case VSConstants.VSStd2KCmdID.FILETYPESEDITOR:
                case VSConstants.VSStd2KCmdID.USERINTERFACEEDITOR:
                case VSConstants.VSStd2KCmdID.CUSTOMACTIONSEDITOR:
                case VSConstants.VSStd2KCmdID.LAUNCHCONDITIONSEDITOR:
                case VSConstants.VSStd2KCmdID.EDITOR:
                case VSConstants.VSStd2KCmdID.VIEWDEPENDENCIES:
                case VSConstants.VSStd2KCmdID.VIEWFILTER:
                case VSConstants.VSStd2KCmdID.VIEWOUTPUTS:
                case VSConstants.VSStd2KCmdID.RENAME:
                case VSConstants.VSStd2KCmdID.ADDOUTPUT:
                case VSConstants.VSStd2KCmdID.ADDFILE:
                case VSConstants.VSStd2KCmdID.MERGEMODULE:
                case VSConstants.VSStd2KCmdID.ADDCOMPONENTS:
                case VSConstants.VSStd2KCmdID.ADDWFCFORM:
                    return true;
            }

            return false;
        }
开发者ID:bentayloruk,项目名称:VsVim,代码行数:29,代码来源:OleCommandUtil.cs

示例3: HandleCommand

        public bool HandleCommand(VSConstants.VSStd2KCmdID key)
        {
            if (!m_adorned)
                return false;

            if(_translationAdornmentFocused != null && _translationAdornmentFocused.MenuIsOpen)
                return true;

            // Debug.WriteLine(">> VSStd2KCmdID: {0}", key);

            switch (key)
            {
                case VSConstants.VSStd2KCmdID.RETURN:
                case VSConstants.VSStd2KCmdID.TYPECHAR:
                    if (_translationAdornmentFocused != null)
                        _translationAdornmentFocused.TryReplaceWithCurrentItem();
                    return true;
                case VSConstants.VSStd2KCmdID.UP:
                    if (_translationAdornmentFocused != null)
                        _translationAdornmentFocused.MoveCurrentItem(true);
                    return true;
                case VSConstants.VSStd2KCmdID.DOWN:
                    if (_translationAdornmentFocused != null)
                        _translationAdornmentFocused.MoveCurrentItem(false);
                    return true;
                case VSConstants.VSStd2KCmdID.LEFT:
                    if (_translationAdornmentFocused != null)
                        _translationAdornmentFocused.CloseCurrentItemMenu();
                    return true;
                case VSConstants.VSStd2KCmdID.RIGHT:
                case VSConstants.VSStd2KCmdID.SHOWCONTEXTMENU:
                    if (_translationAdornmentFocused != null)
                        _translationAdornmentFocused.OpenCurrentItemMenu();
                    return true;
                case VSConstants.VSStd2KCmdID.CANCEL:
                    ClearTranslations();
                    return true;
                case VSConstants.VSStd2KCmdID.COPY:
                    if (_translationAdornmentFocused != null)
                        _translationAdornmentFocused.CopyCurrentItemText();
                    return true;
                case VSConstants.VSStd2KCmdID.INSERT:
                case VSConstants.VSStd2KCmdID.DELETE:
                case VSConstants.VSStd2KCmdID.BACKSPACE:
                case VSConstants.VSStd2KCmdID.TAB:
                case VSConstants.VSStd2KCmdID.END:
                case VSConstants.VSStd2KCmdID.HOME:
                case VSConstants.VSStd2KCmdID.PAGEDN:
                case VSConstants.VSStd2KCmdID.PAGEUP:
                case VSConstants.VSStd2KCmdID.PASTE:
                case VSConstants.VSStd2KCmdID.PASTEASHTML:
                case VSConstants.VSStd2KCmdID.BOL:
                case VSConstants.VSStd2KCmdID.EOL:
                case VSConstants.VSStd2KCmdID.BACKTAB:
                    return true;
            }

            return false;
        }
开发者ID:julianpaulozzi,项目名称:VSNewTranslator,代码行数:59,代码来源:TranslationAdornmentManager.cs

示例4:

 public override string Goto
     (
     VSConstants.VSStd97CmdID cmd,
     IVsTextView textView,
     int line,
     int col,
     out TextSpan span)
     => _data.Goto(cmd, textView, line, col, out span);
开发者ID:hahoyer,项目名称:reni.cs,代码行数:8,代码来源:AuthoringScopeWrapper.cs

示例5: TextSpan

 public string Goto
     (
     VSConstants.VSStd97CmdID cmd,
     IVsTextView textView,
     int line,
     int col,
     out TextSpan span)
 {
     span = new TextSpan();
     NotImplementedMethod(cmd, textView, line, col, span);
     return null;
 }
开发者ID:hahoyer,项目名称:reni.cs,代码行数:12,代码来源:AuthoringScope.cs

示例6: OnCommand

        public override void OnCommand(IVsTextView textView, VSConstants.VSStd2KCmdID command, char ch)
        {
            base.OnCommand(textView, command, ch);
            //if (command == VSConstants.VSStd2KCmdID.ECMD_RENAMESYMBOL)
            //{
            //    System.Diagnostics.Debug.WriteLine(command);
            //}
            /*
            if (command == VSConstants.VSStd2KCmdID.TYPECHAR)
            {
                int line, col;
                textView.GetCaretPos(out line, out col);

                TokenInfo tokenInfo = this.GetTokenInfo(line, col);

                if (tokenInfo.Type == TokenType.Identifier && !this.IsCompletorActive)
                    this.Completion(textView, tokenInfo, ParseReason.CompleteWord);
            }
            */
        }
开发者ID:jda808,项目名称:NPL,代码行数:20,代码来源:LuaSource.cs

示例7: HandleElementValueChanged

        private void HandleElementValueChanged(VSConstants.VSSELELEMID elementId, object oldValue, object newValue)
        {
            switch (elementId)
            {
            case VSConstants.VSSELELEMID.SEID_DocumentFrame:
                var viewChanged = ViewChanged;
                if (viewChanged != null)
                {
                    ITextView oldView = GetTextView((IVsWindowFrame)oldValue);
                    ITextView newView = GetTextView((IVsWindowFrame)newValue);
                    ViewChangedEventArgs e = new ViewChangedEventArgs(oldView, newView);
                    viewChanged(this, e);
                }

                return;

            case VSConstants.VSSELELEMID.SEID_LastWindowFrame:
                break;

            case VSConstants.VSSELELEMID.SEID_PropertyBrowserSID:
                break;

            case VSConstants.VSSELELEMID.SEID_ResultList:
                break;

            case VSConstants.VSSELELEMID.SEID_StartupProject:
                break;

            case VSConstants.VSSELELEMID.SEID_UndoManager:
                break;

            case VSConstants.VSSELELEMID.SEID_UserContext:
                break;

            case VSConstants.VSSELELEMID.SEID_WindowFrame:
                break;

            default:
                break;
            }
        }
开发者ID:sebandraos,项目名称:LangSvcV2,代码行数:41,代码来源:MonitorSelectionService.cs

示例8: TryConvert

        internal static bool TryConvert(VSConstants.VSStd2KCmdID cmdId, IntPtr variantIn, out KeyInput ki, out EditCommandKind kind)
        {
            kind = EditCommandKind.Unknown;
            ki = null;
            switch (cmdId)
            {
                case VSConstants.VSStd2KCmdID.TYPECHAR:
                    if (variantIn == IntPtr.Zero)
                    {
                        ki = KeyInputUtil.CharToKeyInput(Char.MinValue);
                    }
                    else
                    {
                        var obj = Marshal.GetObjectForNativeVariant(variantIn);
                        var c = (char)(ushort)obj;
                        ki = KeyInputUtil.CharToKeyInput(c);
                    }
                    kind = EditCommandKind.TypeChar;
                    break;
                case VSConstants.VSStd2KCmdID.RETURN:
                    ki = KeyInputUtil.EnterKey;
                    kind = EditCommandKind.Return;
                    break;
                case VSConstants.VSStd2KCmdID.CANCEL:
                    ki = KeyInputUtil.EscapeKey;
                    kind = EditCommandKind.Cancel;
                    break;
                case VSConstants.VSStd2KCmdID.DELETE:
                    ki = KeyInputUtil.VimKeyToKeyInput(VimKey.Delete);
                    kind = EditCommandKind.Delete;
                    break;
                case VSConstants.VSStd2KCmdID.BACKSPACE:
                    ki = KeyInputUtil.VimKeyToKeyInput(VimKey.Back);
                    kind = EditCommandKind.Backspace;
                    break;
                case VSConstants.VSStd2KCmdID.LEFT:
                case VSConstants.VSStd2KCmdID.LEFT_EXT:
                case VSConstants.VSStd2KCmdID.LEFT_EXT_COL:
                    ki = KeyInputUtil.VimKeyToKeyInput(VimKey.Left);
                    kind = EditCommandKind.CursorMovement;
                    break;
                case VSConstants.VSStd2KCmdID.RIGHT:
                case VSConstants.VSStd2KCmdID.RIGHT_EXT:
                case VSConstants.VSStd2KCmdID.RIGHT_EXT_COL:
                    ki = KeyInputUtil.VimKeyToKeyInput(VimKey.Right);
                    kind = EditCommandKind.CursorMovement;
                    break;
                case VSConstants.VSStd2KCmdID.UP:
                case VSConstants.VSStd2KCmdID.UP_EXT:
                case VSConstants.VSStd2KCmdID.UP_EXT_COL:
                    ki = KeyInputUtil.VimKeyToKeyInput(VimKey.Up);
                    kind = EditCommandKind.CursorMovement;
                    break;
                case VSConstants.VSStd2KCmdID.DOWN:
                case VSConstants.VSStd2KCmdID.DOWN_EXT:
                case VSConstants.VSStd2KCmdID.DOWN_EXT_COL:
                    ki = KeyInputUtil.VimKeyToKeyInput(VimKey.Down);
                    kind = EditCommandKind.CursorMovement;
                    break;
                case VSConstants.VSStd2KCmdID.TAB:
                    ki = KeyInputUtil.TabKey;
                    kind = EditCommandKind.TypeChar;
                    break;
                case VSConstants.VSStd2KCmdID.PAGEDN:
                case VSConstants.VSStd2KCmdID.PAGEDN_EXT:
                    ki = KeyInputUtil.VimKeyToKeyInput(VimKey.PageDown);
                    kind = EditCommandKind.CursorMovement;
                    break;
                case VSConstants.VSStd2KCmdID.PAGEUP:
                case VSConstants.VSStd2KCmdID.PAGEUP_EXT:
                    ki = KeyInputUtil.VimKeyToKeyInput(VimKey.PageUp);
                    kind = EditCommandKind.CursorMovement;
                    break;
                case VSConstants.VSStd2KCmdID.UNDO:
                case VSConstants.VSStd2KCmdID.UNDONOMOVE:
                    ki = KeyInput.DefaultValue;
                    kind = EditCommandKind.Undo;
                    break;
                case VSConstants.VSStd2KCmdID.REDO:
                case VSConstants.VSStd2KCmdID.REDONOMOVE:
                    ki = KeyInput.DefaultValue;
                    kind = EditCommandKind.Redo;
                    break;
                default:
                    break;
            }

            return ki != null;
        }
开发者ID:bentayloruk,项目名称:VsVim,代码行数:89,代码来源:OleCommandUtil.cs

示例9: AssertCannotConvert2K

 private void AssertCannotConvert2K(VSConstants.VSStd2KCmdID id)
 {
     KeyInput ki;
     Assert.IsFalse(_targetRaw.TryConvert(VSConstants.VSStd2K, (uint)id, IntPtr.Zero, out ki));
 }
开发者ID:bentayloruk,项目名称:VsVim,代码行数:5,代码来源:VsCommandTargetTest.cs

示例10: AssertCanConvert2K

 private void AssertCanConvert2K(VSConstants.VSStd2KCmdID id, KeyInput expected)
 {
     KeyInput ki;
     Assert.IsTrue(_targetRaw.TryConvert(VSConstants.VSStd2K, (uint)id, IntPtr.Zero, out ki));
     Assert.AreEqual(expected, ki);
 }
开发者ID:bentayloruk,项目名称:VsVim,代码行数:6,代码来源:VsCommandTargetTest.cs

示例11: OleCommandData

 internal OleCommandData(VSConstants.VSStd2KCmdID id)
     : this((uint)id)
 {
 }
开发者ID:bentayloruk,项目名称:VsVim,代码行数:4,代码来源:VsCommandTarget.cs

示例12: TryConvert

        /// <summary>
        /// Try and convert a Visual Studio 2000 style command into the associated KeyInput and EditCommand items
        /// </summary>
        internal static bool TryConvert(VSConstants.VSStd2KCmdID cmdId, IntPtr variantIn, out KeyInput keyInput, out EditCommandKind kind, out bool isRawText)
        {
            isRawText = false;
            switch (cmdId)
            {
                case VSConstants.VSStd2KCmdID.TYPECHAR:
                    if (variantIn == IntPtr.Zero)
                    {
                        keyInput = KeyInputUtil.CharToKeyInput(Char.MinValue);
                    }
                    else
                    {
                        var obj = Marshal.GetObjectForNativeVariant(variantIn);
                        var c = (char)(ushort)obj;
                        keyInput = KeyInputUtil.CharToKeyInput(c);
                    }
                    kind = EditCommandKind.UserInput;
                    isRawText = true;
                    break;
                case VSConstants.VSStd2KCmdID.RETURN:
                    keyInput = KeyInputUtil.EnterKey;
                    kind = EditCommandKind.UserInput;
                    break;
                case VSConstants.VSStd2KCmdID.CANCEL:
                    keyInput = KeyInputUtil.EscapeKey;
                    kind = EditCommandKind.UserInput;
                    break;
                case VSConstants.VSStd2KCmdID.DELETE:
                    keyInput = KeyInputUtil.VimKeyToKeyInput(VimKey.Delete);
                    kind = EditCommandKind.UserInput;
                    break;
                case VSConstants.VSStd2KCmdID.BACKSPACE:
                    keyInput = KeyInputUtil.VimKeyToKeyInput(VimKey.Back);
                    kind = EditCommandKind.UserInput;
                    break;
                case VSConstants.VSStd2KCmdID.LEFT:
                    keyInput = KeyInputUtil.VimKeyToKeyInput(VimKey.Left);
                    kind = EditCommandKind.UserInput;
                    break;
                case VSConstants.VSStd2KCmdID.LEFT_EXT:
                case VSConstants.VSStd2KCmdID.LEFT_EXT_COL:
                    keyInput = KeyInputUtil.ApplyModifiersToVimKey(VimKey.Left, KeyModifiers.Shift);
                    kind = EditCommandKind.VisualStudioCommand;
                    break;
                case VSConstants.VSStd2KCmdID.RIGHT:
                    keyInput = KeyInputUtil.VimKeyToKeyInput(VimKey.Right);
                    kind = EditCommandKind.UserInput;
                    break;
                case VSConstants.VSStd2KCmdID.RIGHT_EXT:
                case VSConstants.VSStd2KCmdID.RIGHT_EXT_COL:
                    keyInput = KeyInputUtil.ApplyModifiersToVimKey(VimKey.Right, KeyModifiers.Shift);
                    kind = EditCommandKind.VisualStudioCommand;
                    break;
                case VSConstants.VSStd2KCmdID.UP:
                    keyInput = KeyInputUtil.VimKeyToKeyInput(VimKey.Up);
                    kind = EditCommandKind.UserInput;
                    break;
                case VSConstants.VSStd2KCmdID.UP_EXT:
                case VSConstants.VSStd2KCmdID.UP_EXT_COL:
                    keyInput = KeyInputUtil.ApplyModifiersToVimKey(VimKey.Up, KeyModifiers.Shift);
                    kind = EditCommandKind.VisualStudioCommand;
                    break;
                case VSConstants.VSStd2KCmdID.DOWN:
                    keyInput = KeyInputUtil.VimKeyToKeyInput(VimKey.Down);
                    kind = EditCommandKind.UserInput;
                    break;
                case VSConstants.VSStd2KCmdID.DOWN_EXT:
                case VSConstants.VSStd2KCmdID.DOWN_EXT_COL:
                    keyInput = KeyInputUtil.ApplyModifiersToVimKey(VimKey.Down, KeyModifiers.Shift);
                    kind = EditCommandKind.VisualStudioCommand;
                    break;
                case VSConstants.VSStd2KCmdID.TAB:
                    keyInput = KeyInputUtil.TabKey;
                    kind = EditCommandKind.UserInput;
                    break;
                case VSConstants.VSStd2KCmdID.BACKTAB:
                    keyInput = KeyInputUtil.ApplyModifiersToVimKey(VimKey.Tab, KeyModifiers.Shift);
                    kind = EditCommandKind.UserInput;
                    break;
                case VSConstants.VSStd2KCmdID.PAGEDN:
                    keyInput = KeyInputUtil.VimKeyToKeyInput(VimKey.PageDown);
                    kind = EditCommandKind.UserInput;
                    break;
                case VSConstants.VSStd2KCmdID.PAGEDN_EXT:
                    keyInput = KeyInputUtil.ApplyModifiersToVimKey(VimKey.PageDown, KeyModifiers.Shift);
                    kind = EditCommandKind.VisualStudioCommand;
                    break;
                case VSConstants.VSStd2KCmdID.PAGEUP:
                    keyInput = KeyInputUtil.VimKeyToKeyInput(VimKey.PageUp);
                    kind = EditCommandKind.UserInput;
                    break;
                case VSConstants.VSStd2KCmdID.PAGEUP_EXT:
                    keyInput = KeyInputUtil.ApplyModifiersToVimKey(VimKey.PageUp, KeyModifiers.Shift);
                    kind = EditCommandKind.VisualStudioCommand;
                    break;
                case VSConstants.VSStd2KCmdID.UNDO:
                case VSConstants.VSStd2KCmdID.UNDONOMOVE:
//.........这里部分代码省略.........
开发者ID:aesire,项目名称:VsVim,代码行数:101,代码来源:OleCommandUtil.cs

示例13: Goto

 // ParseReason.Goto
 // Called by Visual Studio to get the go to function
 // this has not been implemented yet
 public override string Goto(VSConstants.VSStd97CmdID cmd, IVsTextView textView, int line, int col, out TextSpan span)
 {
     // throw new System.NotImplementedException();
     span = new TextSpan();
     return null;
 }
开发者ID:JohnLouderback,项目名称:shadersense,代码行数:9,代码来源:HLSLAuthoringScope.cs

示例14: FirstChild

        private static VSConstants.VSITEMID FirstChild(IVsHierarchy hierarchy, VSConstants.VSITEMID rootID)
        {
            object childIDObj = null;
            hierarchy.GetProperty((uint)rootID, (int)__VSHPROPID.VSHPROPID_FirstChild, out childIDObj);
            if (childIDObj != null)
            {
                return (VSConstants.VSITEMID)(int)childIDObj;
            }

            return VSConstants.VSITEMID.Nil;
        }
开发者ID:thennequin,项目名称:VS-QuickNavigation,代码行数:11,代码来源:FileList.cs

示例15: ExecuteCommand

 private void ExecuteCommand(VSConstants.VSStd2KCmdID idCommand, object args = null)
 {
     OldChain.Execute(idCommand, args);
 }
开发者ID:plkumar,项目名称:jish,代码行数:4,代码来源:WpfConsoleKeyProcessor.cs


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