本文整理汇总了C#中DomMethod.AddChild方法的典型用法代码示例。如果您正苦于以下问题:C# DomMethod.AddChild方法的具体用法?C# DomMethod.AddChild怎么用?C# DomMethod.AddChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DomMethod
的用法示例。
在下文中一共展示了DomMethod.AddChild方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConvertDParserToDomNode
public static MonoDevelop.Projects.Dom.INode ConvertDParserToDomNode(D_Parser.Dom.INode n, ParsedDocument doc)
{
//TODO: DDoc comments!
if (n is DMethod)
{
var dm = n as DMethod;
var domMethod = new DomMethod(
n.Name,
GetNodeModifiers(dm),
dm.SpecialType == DMethod.MethodType.Constructor ? MethodModifier.IsConstructor : MethodModifier.None,
FromCodeLocation(n.StartLocation),
GetBlockBodyRegion(dm),
GetReturnType(n));
foreach (var pn in dm.Parameters)
domMethod.Add(new DomParameter(domMethod, pn.Name, GetReturnType(pn)));
domMethod.AddTypeParameter(GetTypeParameters(dm));
foreach (var subNode in dm) domMethod.AddChild(ConvertDParserToDomNode(subNode, doc));
return domMethod;
}
else if (n is DEnum)
{
var de = n as DEnum;
var domType = new DomType(
doc.CompilationUnit,
ClassType.Enum,
GetNodeModifiers(de),
n.Name,
FromCodeLocation(n.StartLocation),
BuildTypeNamespace(n), GetBlockBodyRegion(de));
foreach (var subNode in de)
domType.Add(ConvertDParserToDomNode(subNode, doc) as IMember);
return domType;
}
else if (n is DClassLike)
{
var dc = n as DClassLike;
ClassType ct = ClassType.Unknown;
switch (dc.ClassType)
{
case DTokens.Template:
case DTokens.Class:
ct = ClassType.Class;
break;
case DTokens.Interface:
ct = ClassType.Interface;
break;
case DTokens.Union:
case DTokens.Struct:
ct = ClassType.Struct;
break;
}
var domType = new DomType(
doc.CompilationUnit,
ct,
GetNodeModifiers(dc),
n.Name,
FromCodeLocation(n.StartLocation),
BuildTypeNamespace(n),
GetBlockBodyRegion(dc));
domType.AddTypeParameter(GetTypeParameters(dc));
foreach (var subNode in dc)
domType.Add(ConvertDParserToDomNode(subNode, doc) as IMember);
return domType;
}
else if (n is DVariable)
{
var dv = n as DVariable;
return new DomField(n.Name, GetNodeModifiers(dv), FromCodeLocation(n.StartLocation), GetReturnType(n));
}
return null;
}