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


C# CompletionDataList.Find方法代码示例

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


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

示例1: CheckStaticObjectMembers

		public static void CheckStaticObjectMembers (CompletionDataList provider)
		{
			Assert.IsNotNull (provider.Find ("Equals"), "Method 'System.Object.Equals' not found.");
			Assert.IsNotNull (provider.Find ("ReferenceEquals"), "Method 'System.Object.ReferenceEquals' not found.");
		}
开发者ID:pgoron,项目名称:monodevelop,代码行数:5,代码来源:CodeCompletionBugTests.cs

示例2: CheckProtectedObjectMembers

		public static void CheckProtectedObjectMembers (CompletionDataList provider)
		{
			CheckObjectMembers (provider);
			Assert.IsNotNull (provider.Find ("MemberwiseClone"), "Method 'System.Object.MemberwiseClone' not found.");
		}
开发者ID:pgoron,项目名称:monodevelop,代码行数:5,代码来源:CodeCompletionBugTests.cs

示例3: GetCompletionData

        private CompletionDataList GetCompletionData(CompletionTyp completiontype, bool onlyOne )
        {
            CompletionDataList listComplete = new CompletionDataList();

            if(completiontype == CompletionTyp.includeType){
                listComplete.Add(new CompletionData("lib",null,"lib","lib://"));
                listComplete.Add(new CompletionData("app",null,"app","app://"));
                return listComplete;
            }

            if(MainClass.CompletedCache.ListDataKeywords != null){
                foreach (CompletionData cd in MainClass.CompletedCache.ListDataKeywords) {
                    if ( cd != null ){

                        CompletionData cdParent =listComplete.Find(cd.DisplayText);

                        if ((cdParent== null) || (!onlyOne))  {

                            if (completiontype != CompletionTyp.newType){
                                cdParent =cd.Clone();
                                cdParent.OverloadedData.Add(cd.Clone());
                                listComplete.Add(cdParent);
                            }
                        } else {
                            if(!cdParent.Description.Contains(cd.Description)){
                                cdParent.IsOverloaded = true;
                                cdParent.OverloadedData.Add(cd.Clone());
                                cdParent.Description =cdParent.Description+Environment.NewLine+Environment.NewLine+ cd.Description;

                            }
                        }
                    }
                }
            }

            //Types (from doc T:)
            //i = 0;
            if(MainClass.CompletedCache.ListDataTypes != null){
                foreach (CompletionData cd in MainClass.CompletedCache.ListDataTypes) {
                    if ( cd != null ){
                        CompletionData cdParent =listComplete.Find(cd.DisplayText);
                        if ((cdParent== null) || (!onlyOne)){

                            if (completiontype != CompletionTyp.dotType){
                                cdParent =cd.Clone();
                                cdParent.OverloadedData.Add(cd.Clone());
                                listComplete.Add(cdParent);
                            }
                        } else {
                            if(!cdParent.Description.Contains(cd.Description)){
                                cdParent.IsOverloaded = true;
                                cdParent.OverloadedData.Add(cd.Clone());
                                cdParent.Description =cdParent.Description+Environment.NewLine+Environment.NewLine+ cd.Description;
                            }
                        }
                    }
                }
            }

            // M P E

            //Member (from doc M: )
            //i = 0;
            if(MainClass.CompletedCache.ListDataMembers != null){
                foreach (CompletionData cd in MainClass.CompletedCache.ListDataMembers) {
                    if ( cd != null ){
                        //if (cd.DisplayText==baseWord)
                        //	i++;

                        CompletionData cdParent =listComplete.Find(cd.DisplayText);
                        if ((cdParent== null) || (!onlyOne)){
                            if (completiontype != CompletionTyp.newType){
                                cdParent =cd.Clone();
                                cdParent.OverloadedData.Add(cd.Clone());
                                listComplete.Add(cdParent);
                            }
                        }  else {
                            if(!cdParent.Description.Contains(cd.Description)){
                                cdParent.IsOverloaded = true;
                                cdParent.OverloadedData.Add(cd.Clone());
                                cdParent.Description =cdParent.Description+Environment.NewLine+Environment.NewLine+ cd.Description;
                            }
                        }
                    }
                }
            }

            //Member (from doc P:)
            //i = 0;
            if(MainClass.CompletedCache.ListDataProperties != null){
                foreach (CompletionData cd in MainClass.CompletedCache.ListDataProperties) {
                    if ( cd != null ){
                        //if (cd.DisplayText==baseWord)
                        //	i++;
                        //if(!onlyOne)
                        //	if(cd.DisplayText=="width")
                        //		Console.WriteLine("1");

                        CompletionData cdParent =listComplete.Find(cd.DisplayText);
                        if ((cdParent== null) || (!onlyOne)){
//.........这里部分代码省略.........
开发者ID:moscrif,项目名称:ide,代码行数:101,代码来源:CompletedCache.cs

示例4: CheckObjectMembers

		public static void CheckObjectMembers (CompletionDataList provider)
		{
			Assert.IsNotNull (provider.Find ("Equals"), "Method 'System.Object.Equals' not found.");
			Assert.IsNotNull (provider.Find ("GetHashCode"), "Method 'System.Object.GetHashCode' not found.");
			Assert.IsNotNull (provider.Find ("GetType"), "Method 'System.Object.GetType' not found.");
			Assert.IsNotNull (provider.Find ("ToString"), "Method 'System.Object.ToString' not found.");
		}
开发者ID:pgoron,项目名称:monodevelop,代码行数:7,代码来源:CodeCompletionBugTests.cs

示例5: GetCompletionData

        /// <summary>
        /// Vrati vsetky mozne autokompletion , do zoznamu prida aj slova zo samotneho dokumentu
        /// </summary>
        /// <returns>
        /// Zoznam autoCompletion slov odpovesajuci baseWord a completiontype
        /// </returns>
        public static ICompletionDataList GetCompletionData(this TextEditor editor ,string baseWord,string fullWord ,CompletionTyp completiontype)
        {
            string codestring = editor.Document.Text;
            string type = "";
            string parent = "";

            editor.ParseString(fullWord,out parent,out type);

            Regex regex = new Regex(@"\W", RegexOptions.Compiled);
            codestring = regex.Replace(codestring, " ");

            string[] list = codestring.Split(' ');
            CompletionDataList listComplete = new CompletionDataList();
            listComplete.CompletionSelectionMode = CompletionSelectionMode.OwnTextField;

            if(!String.IsNullOrEmpty(type)){
                //List<CompletionData> lst = MainClass.CompletedCache.AllCompletionOnlyOne.FindAll(x=>x.Parent == type);
                List<CompletionData> lst = MainClass.CompletedCache.AllCompletionRepeat.FindAll(x=>x.Parent == type);
                foreach ( CompletionData cd in lst){
                    string expres =cd.Parent+".on";
                    if(cd.Signature.StartsWith(expres) ){
                        //expres = cd.Signature.Replace(cd.Parent+".", cd.DisplayText +" = function ");
                        expres = cd.Signature.Replace(cd.Parent+"."+ cd.DisplayText, cd.DisplayText +" = function ");
                        cd.DisplayDescription =expres+"{}";
                        cd.CompletionText =expres+"{"+Environment.NewLine+"}";
                    }

                }

                if (lst != null)
                    listComplete.AddRange(lst.ToArray());

                if(listComplete != null && listComplete.Count>0){
                    return listComplete;
                }
            }

            switch (completiontype) {
            case CompletionTyp.allType:
                {
                    listComplete.AddRange(MainClass.CompletedCache.AllCompletionOnlyOne);
                    break;
                }
            case CompletionTyp.newType:
                {
                    listComplete.AddRange(MainClass.CompletedCache.NewCompletion);
                    break;
                }
            case CompletionTyp.dotType:
                {
                    listComplete.AddRange(MainClass.CompletedCache.DotCompletion);
                    break;
                }
            }

            int i = 0;
            foreach (string s in list) {
                if ( !String.IsNullOrEmpty(s.Trim()) ){
                    if (s==baseWord)
                        i++;

                    if ((listComplete.Find(s)== null) && (s.Length>2) && ( (s!= baseWord) || (i ==1) ) ){
                        CompletionData cd = new CompletionData(s, null, s, s);

                        if (completiontype == CompletionTyp.newType){
                            if(char.ToUpper(s[0]) == s[0]  && !char.IsDigit(s[0]) && !char.IsSymbol(s[0]) &&char.IsLetter(s[0]) ){

                                CompletionData cdParent =listComplete.Find(cd.DisplayText);
                                if (cdParent== null){
                                    listComplete.Add(cd);
                                } else {
                                    if(!cdParent.Description.Contains(cd.Description))
                                        cdParent.Description =cdParent.Description+Environment.NewLine+cd.Description;
                                }
                            }
                        }  else{
                            CompletionData cdParent =listComplete.Find(cd.DisplayText);
                            if (cdParent== null){
                                listComplete.Add(cd);
                            } else {
                                if(!cdParent.Description.Contains(cd.Description))
                                    cdParent.Description =cdParent.Description+Environment.NewLine+cd.Description;
                            }
                        }
                    }
                }
            }

             			return listComplete;
        }
开发者ID:moscrif,项目名称:ide,代码行数:96,代码来源:TextEditorExtensions.cs


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