• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Interfaces.IntellisenseProviderContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: GetIntellisenseResults

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

            IList<IIntellisenseResult> oldResults = GetIntellisenseResultsImpl(context);
            
            var results = new List<IntellisenseProviderResult>();

            if (oldResults != null)
            {
                foreach (IIntellisenseResult currentResult in oldResults)
                {
                    if (currentResult.ErrorCode != enIntellisenseErrorCode.None)
                    {
                        if (currentResult.Type == enIntellisenseResultType.Error && currentResult.IsClosedRegion)
                        {
                            results.Add(new IntellisenseProviderResult(this, currentResult.Option.DisplayValue, currentResult.Message, currentResult.Message, true));
                        }
                    }

                    if (currentResult.Type == enIntellisenseResultType.Selectable)
                    {
                        results.Add(new IntellisenseProviderResult(this, currentResult.Option.DisplayValue, currentResult.Option.Description, currentResult.Option.Description, false));
                    }
                }
            }

            return results;
        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:32,代码来源:DateTimeIntellisenseProvider.cs


示例2: GetIntellisenseResults

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

            var results = new List<IntellisenseProviderResult>();
            if(context.DesiredResultSet == IntellisenseDesiredResultSet.EntireSet)
            {
                FileSystemQuery.QueryList("");
                FileSystemQuery.QueryCollection.ForEach(s => IntellisenseResults.Add(new IntellisenseProviderResult(this, s, string.Empty, string.Empty, false)));
                results.AddRange(IntellisenseResults);
            }
            else
            {
                if(!InLiteralRegion(context.InputText, context.CaretPosition))
                {
                    IntellisenseResults.Clear();
                    var regions = context.InputText.Split(' ');
                    var sum = 0;
                    string searchText = regions.Select(a => new { a, a.Length }).TakeWhile(a =>
                        {
                            sum = sum + context.CaretPosition;
                            return sum >= context.CaretPosition;
                        }).Last().a;
                    FileSystemQuery.QueryList(searchText);
                    FileSystemQuery.QueryCollection.ForEach(s => IntellisenseResults.Add(new IntellisenseProviderResult(this, s, string.Empty, string.Empty, false)));
                    results.AddRange(IntellisenseResults);
                }
            }
            return results;
        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:33,代码来源:FileSystemIntellisenseProvider.cs


示例3: PerformResultInsertion

        public string PerformResultInsertion(string input, IntellisenseProviderContext context)
        {
            VerifyArgument.IsNotNull("Context",context);
           
            string inputText = context.InputText ?? string.Empty;
            int caretPosition = context.CaretPosition;  

            if (caretPosition < 0 || caretPosition>inputText.Length)
                return string.Empty;

            var regions = inputText.Split(' '); // we can safely do this because the default provider handles the language features

            var sum = 0;
            int items = 0;
            var regionsText = regions.Select(a => new { a, a.Length }).TakeWhile(a =>
            {
                sum = sum + a.Length;
                items++;
                return sum <= caretPosition || items==1;
            }).Select(a => a.a).ToList();
            regionsText[regionsText.Count - 1] = input;// set caret region to replacement text

            var prefix = regionsText.Aggregate("", (a, b) => a + " " + b).TrimStart(' '); // fold back together
            context.CaretPositionOnPopup = prefix.Length;
            context.CaretPosition = prefix.Length;
            int i = 0;
            var inner = regions.SkipWhile(a =>
                {
                    i = i + 1;
                    return i < regionsText.Count + 1;
                }).Aggregate("", (a, b) => a + " " + b);
            return (prefix + inner).TrimEnd();

        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:34,代码来源:FileSystemIntellisenseProvider.cs


示例4: CalculateIntellisenseProvider_GetIntellisenseResults_CalculateModeIsFalse_ResultCountIsZero

        public void CalculateIntellisenseProvider_GetIntellisenseResults_CalculateModeIsFalse_ResultCountIsZero()
        {
            var context = new IntellisenseProviderContext
                {
                    CaretPosition = 2,
                    InputText = "se",
                    IsInCalculateMode = false,
                    DesiredResultSet = IntellisenseDesiredResultSet.ClosestMatch
                };

            CalculateIntellisenseProvider calculateIntellisenseProvider = GetCalculateProvider(false);
            IList<IntellisenseProviderResult> results = calculateIntellisenseProvider.GetIntellisenseResults(context);
            Assert.AreEqual(0, results.Count);
        }
开发者ID:Robin--,项目名称:Warewolf,代码行数:14,代码来源:CalculateIntellisenseProviderTest.cs


示例5: CalculateIntellisenseProvider_GetIntellisenseResults_DesiredIsEntireSet_ResultAllResult

        public void CalculateIntellisenseProvider_GetIntellisenseResults_DesiredIsEntireSet_ResultAllResult()
        {
            var context = new IntellisenseProviderContext
                {
                    CaretPosition = 2,
                    InputText = "se",
                    IsInCalculateMode = true,
                    DesiredResultSet = IntellisenseDesiredResultSet.EntireSet
                };

            CalculateIntellisenseProvider calculateIntellisenseProvider = GetCalculateProvider(false);
            IList<IntellisenseProviderResult> results = calculateIntellisenseProvider.GetIntellisenseResults(context);

            Assert.AreEqual(175, results.Count);
        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:15,代码来源:CalculateIntellisenseProviderTest.cs


示例6: DateTimeIntellisenseProvider_GetIntellisenseResults_PartialMethodMatch_ClosestMatchesReturned

        public void DateTimeIntellisenseProvider_GetIntellisenseResults_PartialMethodMatch_ClosestMatchesReturned()
        {
            var context = new IntellisenseProviderContext
                {
                    CaretPosition = 1,
                    InputText = "d",
                    IsInCalculateMode = false,
                    DesiredResultSet = IntellisenseDesiredResultSet.ClosestMatch
                };

            var dateTimeIntellisenseProvider = new DateTimeIntellisenseProvider();
            IList<IntellisenseProviderResult> results = dateTimeIntellisenseProvider.GetIntellisenseResults(context);

            Assert.AreEqual(6, results.Count);
        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:15,代码来源:DateTimeIntellisenseProviderTests.cs


示例7: FileSystemIntellisenseProvider_ExecuteInsertion

        public void FileSystemIntellisenseProvider_ExecuteInsertion(int caretPosition, string inputText, string inserted, string expected)
        {
            //------------Setup for test--------------------------
            var fileSystemIntellisenseProvider = new FileSystemIntellisenseProvider();

            //------------Execute Test---------------------------
            var context = new IntellisenseProviderContext
            {
                CaretPosition = caretPosition,
                InputText = inputText,
                IsInCalculateMode = false,
                DesiredResultSet = IntellisenseDesiredResultSet.ClosestMatch
            };

               var resp =  fileSystemIntellisenseProvider.PerformResultInsertion(inserted, context);
            //------------Assert Results-------------------------
            Assert.AreEqual(resp, expected);
        }
开发者ID:Robin--,项目名称:Warewolf,代码行数:18,代码来源:FileSystemIntellisenseProviderTest.cs


示例8: CalculateIntellisenseProvider_GetIntellisenseResults_InputBeginsCaretPositonedAfterTwoCharacters_ResultsFilteredBasedOnCharacters

        public void CalculateIntellisenseProvider_GetIntellisenseResults_InputBeginsCaretPositonedAfterTwoCharacters_ResultsFilteredBasedOnCharacters()
        {
            var context = new IntellisenseProviderContext
                {
                    CaretPosition = 2,
                    InputText = "se",
                    IsInCalculateMode = true,
                    DesiredResultSet = IntellisenseDesiredResultSet.ClosestMatch
                };

            CalculateIntellisenseProvider calculateIntellisenseProvider = GetCalculateProvider(false);
            IList<IntellisenseProviderResult> results = calculateIntellisenseProvider.GetIntellisenseResults(context);

            Assert.AreEqual(4, results.Count);
            Assert.AreEqual("search", results[0].Name);
            Assert.AreEqual("searchb", results[1].Name);
            Assert.AreEqual("second", results[2].Name);
            Assert.AreEqual("seriessum", results[3].Name);
        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:19,代码来源:CalculateIntellisenseProviderTest.cs


示例9: GetIntellisenseResults

 public IList<IntellisenseProviderResult> GetIntellisenseResults(IntellisenseProviderContext context)
 {
     var results = new List<IntellisenseProviderResult>();
     if(context.DesiredResultSet == IntellisenseDesiredResultSet.EntireSet)
     {
         FileSystemQuery.QueryList("");
         FileSystemQuery.QueryCollection.ForEach(s => _intellisenseResults.Add(new IntellisenseProviderResult(this, s, string.Empty, string.Empty, false)));
         results.AddRange(_intellisenseResults);
     }
     else
     {
         if(!InLiteralRegion(context.InputText, context.CaretPosition))
         {
             _intellisenseResults.Clear();
             string searchText = context.InputText; //context.InputText.Substring(context.CaretPositionOnPopup, (context.CaretPosition - context.CaretPositionOnPopup));
             FileSystemQuery.QueryList(searchText);
             FileSystemQuery.QueryCollection.ForEach(s => _intellisenseResults.Add(new IntellisenseProviderResult(this, s, string.Empty, string.Empty, false)));
             results.AddRange(_intellisenseResults);
         }
     }
     return results;
 }
开发者ID:Robin--,项目名称:Warewolf,代码行数:22,代码来源:FileSystemIntellisenseProvider.cs


示例10: PerformResultInsertion

 public string PerformResultInsertion(string input, IntellisenseProviderContext context)
 {
     throw new NotSupportedException();
 }
开发者ID:Robin--,项目名称:Warewolf,代码行数:4,代码来源:CalculateIntellisenseProvider.cs


示例11: GetIntellisenseResultsWithOpenRegionAndInRecSetIndexAndWithFieldExpectedAllResults

        public void GetIntellisenseResultsWithOpenRegionAndInRecSetIndexAndWithFieldExpectedAllResults()
        {
            var context = new IntellisenseProviderContext
            {
                CaretPosition = 9,
                InputText = "[[City([[).Name]]",
                DesiredResultSet = IntellisenseDesiredResultSet.Default
            };

            var getResults = new DefaultIntellisenseProvider().GetIntellisenseResults(context);

            Assert.AreEqual(9, getResults.Count);
            Assert.AreEqual("[[Scalar]]", getResults[0].ToString());
            Assert.AreEqual("[[Country]]", getResults[1].ToString());
            Assert.AreEqual("[[State]]", getResults[2].ToString());
            Assert.AreEqual("[[City(", getResults[3].ToString());
            Assert.AreEqual("[[City().Name]]", getResults[4].ToString());
            Assert.AreEqual("[[City(*).Name]]", getResults[5].ToString());
            Assert.AreEqual("[[City().GeoLocation]]", getResults[6].ToString());
            Assert.AreEqual("[[City(*).GeoLocation]]", getResults[7].ToString());
            Assert.AreEqual("Invalid Expression", getResults[8].ToString());
        }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:22,代码来源:DefaultIntellisenseProviderTest.cs


示例12: GetIntellisenseResultsWithInRecSetIndexAndWithFieldAndWithClosingSquareBraceExpectedNoResults

        public void GetIntellisenseResultsWithInRecSetIndexAndWithFieldAndWithClosingSquareBraceExpectedNoResults()
        {
            var context = new IntellisenseProviderContext
            {
                CaretPosition = 13,
                InputText = "[[City([[sca]).Name]]",
                DesiredResultSet = IntellisenseDesiredResultSet.Default
            };

            var getResults = new DefaultIntellisenseProvider().GetIntellisenseResults(context);

            Assert.AreEqual("Invalid expression: Opening and closing brackets dont match.", getResults[0].Description);
        }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:13,代码来源:DefaultIntellisenseProviderTest.cs


示例13: GetIntellisenseResultsWhereCarretPositionLessThanZeroExpectedNoResultsAndException

 public void GetIntellisenseResultsWhereCarretPositionLessThanZeroExpectedNoResultsAndException()
 {
     var context = new IntellisenseProviderContext
     {
         CaretPosition = -1,
         InputText = "Sum([[Scalar]],",
         DesiredResultSet = IntellisenseDesiredResultSet.Default
     };
     var getResults = new DefaultIntellisenseProvider().GetIntellisenseResults(context);
     Assert.AreEqual(0, getResults.Count);
 }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:11,代码来源:DefaultIntellisenseProviderTest.cs


示例14: GetIntellisenseResultsWhereCommaEnteredForInfragisticsFunctonExpectedNoResultsAndException

        public void GetIntellisenseResultsWhereCommaEnteredForInfragisticsFunctonExpectedNoResultsAndException()
        {
            var context = new IntellisenseProviderContext
            {
                CaretPosition = 15,
                InputText = "Sum([[Scalar]],",
                DesiredResultSet = IntellisenseDesiredResultSet.Default
            };

            var getResults = new DefaultIntellisenseProvider().GetIntellisenseResults(context);

            Assert.AreEqual(0, getResults.Count);
        }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:13,代码来源:DefaultIntellisenseProviderTest.cs


示例15: GetIntellisenseResultsWithSumAndAfterCommaAndBeforeBraceExpectedAllVarsInResults

        public void GetIntellisenseResultsWithSumAndAfterCommaAndBeforeBraceExpectedAllVarsInResults()
        {
            var context = new IntellisenseProviderContext
            {
                CaretPosition = 17,
                InputText = "Sum([[Scalar]],[[)",
                DesiredResultSet = IntellisenseDesiredResultSet.EntireSet
            };

            var getResults = new DefaultIntellisenseProvider().GetIntellisenseResults(context);

            Assert.AreEqual(9, getResults.Count);
            Assert.AreEqual("[[Scalar]]", getResults[0].ToString());
            Assert.AreEqual("[[Country]]", getResults[1].ToString());
            Assert.AreEqual("[[State]]", getResults[2].ToString());
            Assert.AreEqual("[[City(", getResults[3].ToString());
            Assert.AreEqual("[[City().Name]]", getResults[4].ToString());
            Assert.AreEqual("[[City(*).Name]]", getResults[5].ToString());
            Assert.AreEqual("[[City().GeoLocation]]", getResults[6].ToString());
            Assert.AreEqual("[[City(*).GeoLocation]]", getResults[7].ToString());
            Assert.AreEqual("Invalid Expression", getResults[8].ToString());
        }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:22,代码来源:DefaultIntellisenseProviderTest.cs


示例16: GetIntellisenseResultsWithCommaSeperatedRegionsAndNumberIndexExpectedNoResults

        public void GetIntellisenseResultsWithCommaSeperatedRegionsAndNumberIndexExpectedNoResults()
        {
            var context = new IntellisenseProviderContext
            {
                CaretPosition = 19,
                InputText = "[[Scalar]],[[City(5).Name]],[[Country]]",
                DesiredResultSet = IntellisenseDesiredResultSet.Default
            };

            var getResults = new DefaultIntellisenseProvider().GetIntellisenseResults(context);

            Assert.AreEqual(0, getResults.Count);
        }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:13,代码来源:DefaultIntellisenseProviderTest.cs


示例17: GetIntellisenseResults_With_Sum_AndAfterComma_Expected_AllVarsInResults

        // ReSharper disable InconsistentNaming
        public void GetIntellisenseResults_With_Sum_AndAfterComma_Expected_AllVarsInResults()
        // ReSharper restore InconsistentNaming
        {
            var context = new IntellisenseProviderContext
            {
                CaretPosition = 17,
                InputText = "Sum([[Scalar]],[[",
                DesiredResultSet = IntellisenseDesiredResultSet.Default
            };
            var getResults = new DefaultIntellisenseProvider().GetIntellisenseResults(context);

            Assert.AreEqual(9, getResults.Count);
            Assert.AreEqual("[[Scalar]]", getResults[0].ToString());
            Assert.AreEqual("[[Country]]", getResults[1].ToString());
            Assert.AreEqual("[[State]]", getResults[2].ToString());
            Assert.AreEqual("[[City(", getResults[3].ToString());
            Assert.AreEqual("[[City().Name]]", getResults[4].ToString());
            Assert.AreEqual("[[City(*).Name]]", getResults[5].ToString());
            Assert.AreEqual("[[City().GeoLocation]]", getResults[6].ToString());
            Assert.AreEqual("[[City(*).GeoLocation]]", getResults[7].ToString());
            Assert.AreEqual("Invalid Expression", getResults[8].ToString());
        }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:23,代码来源:DefaultIntellisenseProviderTest.cs


示例18: IntellisenseProvider_GetIntellisenseResults_WhenOpeningBracketsAndNoRecordset_ValidResults

        public void IntellisenseProvider_GetIntellisenseResults_WhenOpeningBracketsAndNoRecordset_ValidResults()
        {
            //------------Setup for test--------------------------
            var context = new IntellisenseProviderContext
            {
                CaretPosition = 9,
                InputText = "[[city().",
                DesiredResultSet = IntellisenseDesiredResultSet.Default,
                FilterType = enIntellisensePartType.RecordsetFields
            };

            //------------Execute Test---------------------------
            var getResults = new DefaultIntellisenseProvider().GetIntellisenseResults(context);

            //------------Assert Results-------------------------
            Assert.AreEqual(6, getResults.Count);

            Assert.AreEqual("[[City(", getResults[0].ToString());
            Assert.AreEqual("[[City().Name]]", getResults[1].ToString());
            Assert.AreEqual("[[City(*).Name]]", getResults[2].ToString());
            Assert.AreEqual("[[City().GeoLocation]]", getResults[3].ToString());
            Assert.AreEqual("[[City(*).GeoLocation]]", getResults[4].ToString());
            Assert.AreEqual("Invalid Expression", getResults[5].ToString());
        }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:24,代码来源:DefaultIntellisenseProviderTest.cs


示例19: GetIntellisenseResultsWhereBracketOfRecordsetIsClosedAndThereIsAFieldAfterClosedBracketAndStarIndexExpectedNoResultsAndException

        public void GetIntellisenseResultsWhereBracketOfRecordsetIsClosedAndThereIsAFieldAfterClosedBracketAndStarIndexExpectedNoResultsAndException()
        {
            var context = new IntellisenseProviderContext
            {
                CaretPosition = 9,
                InputText = "[[City(*).Name]]",
                DesiredResultSet = IntellisenseDesiredResultSet.Default
            };

            var getResults = new DefaultIntellisenseProvider().GetIntellisenseResults(context);

            Assert.AreEqual(0, getResults.Count);
        }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:13,代码来源:DefaultIntellisenseProviderTest.cs


示例20: GetIntellisenseResultsWithNumberExpectedErrorInResults

        // ReSharper disable InconsistentNaming
        public void GetIntellisenseResultsWithNumberExpectedErrorInResults()
        // ReSharper restore InconsistentNaming
        {
            var context = new IntellisenseProviderContext
            {
                CaretPosition = 3,
                InputText = "[[4]]",
                DesiredResultSet = IntellisenseDesiredResultSet.Default
            };

            var getResults = new DefaultIntellisenseProvider().GetIntellisenseResults(context);

            Assert.AreEqual(1, getResults.Count);
            Assert.AreEqual("Variable name [[4]] begins with a number", getResults[0].Description);
        }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:16,代码来源:DefaultIntellisenseProviderTest.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DataList.DataListViewModel类代码示例发布时间:2022-05-24
下一篇:
C# Security.WindowsGroupPermission类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap