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


C# ICompletionSession.Commit方法代码示例

本文整理汇总了C#中ICompletionSession.Commit方法的典型用法代码示例。如果您正苦于以下问题:C# ICompletionSession.Commit方法的具体用法?C# ICompletionSession.Commit怎么用?C# ICompletionSession.Commit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ICompletionSession的用法示例。


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

示例1: Exec

		public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
		{
			var handled = false;
			var hresult = VSConstants.S_OK;

			if (pguidCmdGroup == VSConstants.VSStd2K)
			{
				switch ((VSConstants.VSStd2KCmdID) nCmdID)
				{
					case VSConstants.VSStd2KCmdID.AUTOCOMPLETE:
					case VSConstants.VSStd2KCmdID.COMPLETEWORD:
						handled = true;
						if (IsSessionStarted) break;
						_currentSession = StartSession();
						break;
					case VSConstants.VSStd2KCmdID.RETURN:
						if (!IsSessionStarted) break;
						handled = true;
						_currentSession.Commit();
						break;
					case VSConstants.VSStd2KCmdID.TAB:
						if (!IsSessionStarted) break;
						handled = true;
						_currentSession.Commit();
						break;
					case VSConstants.VSStd2KCmdID.CANCEL:
						if (!IsSessionStarted) break;
						handled = true;
						_currentSession.Dismiss();
						break;
				}
			}

			if (!handled) hresult = Next.Exec(pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);

			if (ErrorHandler.Succeeded(hresult))
			{
				if (pguidCmdGroup == VSConstants.VSStd2K)
				{
					switch ((VSConstants.VSStd2KCmdID) nCmdID)
					{
						case VSConstants.VSStd2KCmdID.TYPECHAR:
							if (IsSessionStarted) _currentSession.Filter();
							break;
						case VSConstants.VSStd2KCmdID.BACKSPACE:
							if (IsSessionStarted)
							{
								_currentSession.Dismiss();
								_currentSession = StartSession();
							}
							break;
					}
				}
			}

			return hresult;
		}
开发者ID:rpete4130,项目名称:vsClojure,代码行数:57,代码来源:IntellisenseCommandFilter.cs

示例2: TriggerCompletionSession

        internal void TriggerCompletionSession(bool completeWord) {
            Dismiss();

            _activeSession = CompletionBroker.TriggerCompletion(_textView);

            if (_activeSession != null) {
                FuzzyCompletionSet set;
                if (completeWord &&
                    _activeSession.CompletionSets.Count == 1 &&
                    (set = _activeSession.CompletionSets[0] as FuzzyCompletionSet) != null &&
                    set.SelectSingleBest()) {
                    _activeSession.Commit();
                    _activeSession = null;
                } else {
                    _activeSession.Filter();
                    _activeSession.Dismissed += OnCompletionSessionDismissedOrCommitted;
                    _activeSession.Committed += OnCompletionSessionDismissedOrCommitted;
                }
            }
        }
开发者ID:mauricionr,项目名称:nodejstools,代码行数:20,代码来源:IntellisenseController.cs

示例3: SelectSingleBestCompletion

 private bool SelectSingleBestCompletion(ICompletionSession session) {
     if (session.CompletionSets.Count != 1) {
         return false;
     }
     var set = session.CompletionSets[0] as FuzzyCompletionSet;
     if (set == null) {
         return false;
     }
     set.Filter();
     if (set.SelectSingleBest()) {
         session.Commit();
         return true;
     }
     return false;
 }
开发者ID:smallwave,项目名称:PTVS,代码行数:15,代码来源:IntellisenseController.cs

示例4: TriggerCompletionSession

        internal void TriggerCompletionSession(bool completeWord)
        {
            Dismiss();

            _activeSession = CompletionBroker.TriggerCompletion(_textView);

            if (_activeSession != null) {
                if (completeWord &&
                    _activeSession.CompletionSets.Count == 1 &&
                    _activeSession.CompletionSets[0].Completions.Count == 1) {
                    _activeSession.Commit();
                } else {
                    AttachKeyboardFilter();
                    _activeSession.Dismissed += new EventHandler(OnSessionDismissedOrCommitted);
                    _activeSession.Committed += new EventHandler(OnSessionDismissedOrCommitted);
                }
            }
        }
开发者ID:TerabyteX,项目名称:main,代码行数:18,代码来源:IntellisenseController.cs


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