本文整理汇总了C#中ICSharpCode.NRefactory.Ast.FieldDeclaration.AcceptChildren方法的典型用法代码示例。如果您正苦于以下问题:C# FieldDeclaration.AcceptChildren方法的具体用法?C# FieldDeclaration.AcceptChildren怎么用?C# FieldDeclaration.AcceptChildren使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.NRefactory.Ast.FieldDeclaration
的用法示例。
在下文中一共展示了FieldDeclaration.AcceptChildren方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitFieldDeclaration
public override object VisitFieldDeclaration(FieldDeclaration fieldsDeclaration, object data)
{
Contract.Requires(fieldsDeclaration != null);
fieldsDeclaration.AcceptChildren(this, data);
if (fieldsDeclaration.Attributes.Any(s => s.Attributes.Any(a => a.Name == "DataMember")))
{
foreach (var fieldDeclaration in fieldsDeclaration.Fields)
{
var jsProperty = new JsProperty()
{
OfType = fieldsDeclaration.TypeReference.GenericTypes.Count == 0 ?
fieldsDeclaration.TypeReference.Type :
fieldsDeclaration.TypeReference.GenericTypes[0].Type,
Name = fieldDeclaration.Name,
IsArray = (fieldsDeclaration.TypeReference.GenericTypes.Count > 0 ||
fieldsDeclaration.TypeReference.IsArrayType)
};
CurrentParent.Properties.Add(jsProperty);
// I can't figure out what this part is for, but I'm preserving it anyway
if (fieldsDeclaration.Attributes.Count > 0)
{
var jsAttributes = new List<JsAttribute>();
foreach (var attribute in fieldsDeclaration.Attributes)
{
var a = attribute.Attributes[0];
jsAttributes.Add(new JsAttribute()
{
Name = a.Name
});
}
jsProperty.Attributes = jsAttributes;
}
}
}
return null;
}