本文整理汇总了C#中CSsemi.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# CSsemi.Contains方法的具体用法?C# CSsemi.Contains怎么用?C# CSsemi.Contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSsemi
的用法示例。
在下文中一共展示了CSsemi.Contains方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: doAction
public override void doAction(CSsemi.CSemiExp semi)
{
TypeModel tm = new TypeModel();
FileModel fm = new FileModel();
// Console.Write("\n Entering scope: ");
if (semi.Contains("class") != -1)
{
int index = semi.Contains("class");
// Console.Write("class: ");
tm.addType(semi[index + 1], fm.CurrentFile);
}
else if (semi.Contains("struct") != -1)
{
int index = semi.Contains("struct");
//Console.Write("struct: ");
tm.addType(semi[index + 1], fm.CurrentFile);
}
else if (semi.Contains("interface") != -1)
{
int index = semi.Contains("class");
//Console.Write("interface: ");
tm.addType(semi[index + 1], fm.CurrentFile);
}
else if (semi.Contains("enum") != -1)
{
int index = semi.Contains("class");
//Console.Write("enum: ");
tm.addType(semi[index + 1], fm.CurrentFile);
}
else if (semi.Contains("delegte") != -1)
{
int index = semi.Contains("delegate");
//Console.Write("delegate: ");
tm.addType(semi[index + 2], fm.CurrentFile);
}
else
Console.Write("");
}
示例2: test
public override bool test(CSsemi.CSemiExp semi)
{
int indexCL = semi.Contains("class");
int indexIF = semi.Contains("interface");
int indexST = semi.Contains("struct");
int index = Math.Max(indexCL, indexIF);
index = Math.Max(index, indexST);
if (index != -1)
{
CSsemi.CSemiExp local = new CSsemi.CSemiExp();
local.displayNewLines = false;
local.Add(semi[index]).Add(semi[index + 1]);
doActions(local);
}
return false;
}
示例3: test
public override bool test(CSsemi.CSemiExp semi, string filename)
{
int index = semi.Contains("new");
try
{
if (index != -1)
{
List<Elem> table = RepositoryForOutput.storageForOutput_;
foreach (Elem e in table)
{
if ((e.name.Equals(semi[index + 1])) && !(e.type.Equals("function")) && !semi[index + 1].Equals("List"))
{
aggregationTest(semi, index, filename,e.filename, e.namespacename);
return true;
}
}
}
}
catch
{
}
return false;
}
示例4: test
public override bool test(CSsemi.CSemiExp semi, string filename)
{
int index = semi.Contains("}");
if (index != -1)
{
doActions(semi, filename);
return true;
}
return false;
}
示例5: inheritance
// function detect inheritance relationship
public void inheritance(CSsemi.CSemiExp semi, Elem e)
{
int indexCL = semi.Contains("class");
int indexIF = semi.Contains("interface");
int indexST = semi.Contains("struct");
int index = Math.Max(indexCL, indexIF);
index = Math.Max(index, indexST);
if (index != -1)
{
if (semi[index + 2] == ":")
{
if (semi[index + 4] != ".") // like A: B
e.inheritance += semi[index + 3] + " ";
else // like A: namespace.B
e.inheritance += semi[index + 5] + " ";
}
}
}
示例6: test
public override bool test(CSsemi.CSemiExp semi)
{
int index = semi.Contains("{");
if (index != -1)
{
CSsemi.CSemiExp local = new CSsemi.CSemiExp();
// create local semiExp with tokens for type and name
local.displayNewLines = false;
local.Add("control").Add("anonymous");
doActions(local);
return true;
}
return false;
}
示例7: InheritanceAnalyze
// function to analyze inheritance relationship
public void InheritanceAnalyze(CSsemi.CSemiExp local, List<Elem> TABLE)
{
if (local.Contains(":") != -1)
{
int index = local.Contains(":");
foreach (Elem e in TABLE)
{
if (e.name == local[index + 1] && (e.type == "class" || e.type == "struct" || e.type == "interface"))
{
Console.Write("\n inheritance: ");
Console.Write(" {0}", local[index + 1]);
}
}
}
}
示例8: UsingAnalyze
// function to analyze using relationship
public void UsingAnalyze(CSsemi.CSemiExp local, List<Elem> TABLE, Elem e)
{
DetectFunction df = new DetectFunction();
if (df.test(local) == true && local.Contains("(") != -1 && local.Contains(")") != -1 && local.Contains("{") != -1)
{
foreach (Elem ele in TABLE)
{
if (local.Contains(ele.name) > -1 && ele.UsingFlag == false && (ele.type == "class" || ele.type == "interface" || ele.type == "enum"))
{
ele.UsingFlag = true;
Console.Write("\n using: ");
int index = local.Contains(ele.name);
Console.Write(" {0}", local[index]);
continue;
}
}
}
}
示例9: AggregationAnalyze
// function to analyze aggregation relationship
public void AggregationAnalyze(CSsemi.CSemiExp local, List<Elem> TABLE)
{
if (local.Contains("new") != -1)
{
int index = local.Contains("new");
foreach (Elem e in TABLE)
{
if (e.name == local[index + 1] && e.AggregationFlag == false && e.type == "class") //detect B b = new B();
{
e.AggregationFlag = true;
Console.Write("\n aggregation: ");
Console.Write(" {0}", local[index + 1]);
break;
}
else if (e.name == local[index + 3] && e.AggregationFlag == false && e.type == "class") // detect B b = new A.B();
{
e.AggregationFlag = true;
Console.Write("\n aggregation: ");
Console.Write(" {0}", local[index + 3]);
break;
}
}
}
}
示例10: CompositionAnalyze
// function to analyze composition relationship
public void CompositionAnalyze(CSsemi.CSemiExp local, List<Elem> TABLE)
{
foreach (Elem e in TABLE)
{
int index = local.Contains(e.name); //calculate index for class
int index1 = local.Contains("="); //calculate index for "=" for comparision
if (local.Contains(e.name) != -1 && local.Contains("=") != -1 && index < index1 && e.CompositionFlag == false && (e.type == "class" || e.type == "struct" || e.type == "interface" || e.type == "enum"))
if (local.Contains("new") == -1 && e.name == local[index]) // detect B b = a.func() in class A
{
e.CompositionFlag = true;
Console.Write("\n composition: ");
Console.Write(" {0}", local[index]);
break;
}
}
}
示例11: test
public override bool test(CSsemi.CSemiExp semi)
{
int indexDl = semi.Contains("delegate");
if (indexDl != -1)
{
CSsemi.CSemiExp local = new CSsemi.CSemiExp();
// local semiExp with tokens for type and name
local.displayNewLines = false;
local.Add(semi[indexDl]).Add(semi[indexDl+ 2]);
doActions(local);
return true;
}
return false;
}
示例12: aggregation
// function detect aggregation
public void aggregation(CSsemi.CSemiExp semi, Elem e, List<Elem> fileSetInfo)
{
int indexNW = semi.Contains("new");
if (indexNW != -1)
{
if (isSelfDefine(semi[indexNW + 1], fileSetInfo)) // is class defined in other file
{
if (semi[indexNW + 2] != ".") // like "= new class ();"
{
if ((e.aggregation).IndexOf(semi[indexNW + 1]) < 0)
{
e.aggregation += semi[indexNW + 1] + " ";
}
}
else // like "= new namespace.class();"
{
if (e.aggregation.IndexOf(semi[indexNW + 3]) < 0)
{
e.aggregation += semi[indexNW + 3] + " ";
}
}
}
}
}
示例13: composition
// function detect composition
public static void composition(CSsemi.CSemiExp semi, Elem e, List<Elem> fileSetInfo)
{
foreach (Elem elem in fileSetInfo)
{
if (semi.Contains(elem.name) != -1 && semi.Contains("=") != -1 && elem.type == "class" && semi.Contains("=") > semi.Contains(elem.name) || semi.Contains(elem.name) != -1 && semi.Contains("=") != -1 && elem.type == "struct" && semi.Contains("=") > semi.Contains(elem.name) || semi.Contains(elem.name) != -1 && semi.Contains("=") != -1 && elem.type == "enum" && semi.Contains("=") > semi.Contains(elem.name))
if (semi.Contains("new") == -1)
{
if (e.dependency.IndexOf(elem.name) < 0 && e.name != elem.name)
{
e.dependency += elem.name + " ";
}
}
}
}
示例14: composition
// function detect composition
public void composition(CSsemi.CSemiExp semi, Elem e, List<Elem> fileSetInfo)
{
foreach (Elem elem in fileSetInfo)
{
if (semi.Contains(elem.name) != -1 && semi.Contains("=") != -1 && elem.type == "class" || semi.Contains(elem.name) != -1 && semi.Contains("=") != -1 && elem.type == "struct" || semi.Contains(elem.name) != -1 && semi.Contains("=") != -1 && elem.type == "enum")
if (semi.Contains("new") == -1)
{
if (e.composition.IndexOf(elem.name) < 0 )
{
e.composition += elem.name + " ";
}
}
}
}
示例15: test
public override bool test(CSsemi.CSemiExp semi)
{
Display.displayRules(actionDelegate, "rule DetectClass");
int indexCL = semi.Contains("class");
int indexIF = semi.Contains("interface");
int indexST = semi.Contains("struct");
int index = Math.Max(indexCL, indexIF);
index = Math.Max(index, indexST);
if (index != -1)
{
CSsemi.CSemiExp local = new CSsemi.CSemiExp();
// local semiExp with tokens for type and name
local.displayNewLines = false;
local.Add(semi[index]).Add(semi[index + 1]);
doActions(local);
return true;
}
return false;
}