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


C# IntellisenseProviderContext.FindTextToSearch方法代码示例

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


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

示例1: FindTextTestHelper

        private static void FindTextTestHelper(int caretPosition, string inputText, string expectedResult)
        {
            var context = new IntellisenseProviderContext
                {
                    CaretPosition = caretPosition,
                    InputText = inputText,
                    DesiredResultSet = IntellisenseDesiredResultSet.Default
                };

            var search = context.FindTextToSearch();
            Assert.AreEqual(expectedResult, search);
        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:12,代码来源:ProviderExtensionsTest.cs

示例2: GetIntellisenseResults

        public IList<IntellisenseProviderResult> GetIntellisenseResults(IntellisenseProviderContext context)
        {
            if(context == null)
            {
                return new List<IntellisenseProviderResult>();
            }

            var caretPosition = context.CaretPosition;
            var inputText = context.InputText ?? string.Empty;
            var parseEventLog = _syntaxTreeBuilderHelper.EventLog;
            var intellisenseDesiredResultSet = context.DesiredResultSet;

            if((caretPosition == 0 || string.IsNullOrEmpty(inputText))
                && intellisenseDesiredResultSet != IntellisenseDesiredResultSet.EntireSet)
            {
                return EmptyResults;
            }

            if(context.IsInCalculateMode)
            {
                if(intellisenseDesiredResultSet == IntellisenseDesiredResultSet.EntireSet)
                {
                    if(parseEventLog != null) parseEventLog.Clear();

                    if(_syntaxTreeBuilderHelper.EventLog != null && _syntaxTreeBuilderHelper.HasEventLogs)
                    {
                        List<IntellisenseProviderResult> tResults = new List<IntellisenseProviderResult>();
                        tResults.AddRange(IntellisenseResult);
                        return EvaluateEventLogs(tResults, inputText);
                    }

                    return IntellisenseResult;
                }

                Token[] tokens;
                if(intellisenseDesiredResultSet == IntellisenseDesiredResultSet.ClosestMatch)
                {
                    var searchText = context.FindTextToSearch();
                    _syntaxTreeBuilderHelper.Build(searchText, true, out tokens);
                    string sub = string.IsNullOrEmpty(searchText) ? inputText : searchText;

                    List<IntellisenseProviderResult> subResults = IntellisenseResult.Where(t => t.Name.StartsWith(sub)).ToList();

                    if(_syntaxTreeBuilderHelper.EventLog != null && _syntaxTreeBuilderHelper.HasEventLogs)
                    {
                        return EvaluateEventLogs(subResults, inputText);
                    }

                    return subResults;
                }

                _syntaxTreeBuilderHelper.Build(inputText, false, out tokens);

                if(_syntaxTreeBuilderHelper.HasEventLogs)
                {
                    return EvaluateEventLogs(inputText);
                }
            }

            return EmptyResults;
        }
开发者ID:Robin--,项目名称:Warewolf,代码行数:61,代码来源:CalculateIntellisenseProvider.cs

示例3: GetIntellisenseResultsImpl

        public IList<IIntellisenseResult> GetIntellisenseResultsImpl(IntellisenseProviderContext context)
        {
            string searchText = context.FindTextToSearch();
            var results = new List<IIntellisenseResult>();

            if (context.DesiredResultSet == IntellisenseDesiredResultSet.EntireSet)
            {
                results.AddRange(IntellisenseResults);
            }
            else if (!InLiteralRegion(context.InputText, context.CaretPosition))
            {
                var filteredResults = IntellisenseResults.Where(i => i.Option.DisplayValue.ToLower().StartsWith(searchText.ToLower()));
                results.AddRange(filteredResults);
            }
            return results;
        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:16,代码来源:DateTimeIntellisenseProvider.cs


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