本文整理汇总了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.");
}
示例2: CheckProtectedObjectMembers
public static void CheckProtectedObjectMembers (CompletionDataList provider)
{
CheckObjectMembers (provider);
Assert.IsNotNull (provider.Find ("MemberwiseClone"), "Method 'System.Object.MemberwiseClone' not found.");
}
示例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)){
//.........这里部分代码省略.........
示例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.");
}
示例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;
}