本文整理汇总了C#中CSharpSyntaxGenerator.Field类的典型用法代码示例。如果您正苦于以下问题:C# Field类的具体用法?C# Field怎么用?C# Field使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Field类属于CSharpSyntaxGenerator命名空间,在下文中一共展示了Field类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsValueField
private bool IsValueField(Field field)
{
return !IsNodeOrNodeList(field.Type);
}
示例2: IsAutoCreatableNode
private bool IsAutoCreatableNode(Node node, Field field)
{
var referencedNode = GetNode(field.Type);
return (referencedNode != null && RequiredFactoryArgumentCount(referencedNode) == 0);
}
示例3: IsRequiredFactoryField
private bool IsRequiredFactoryField(Node node, Field field)
{
return (!IsOptional(field) && !IsAnyList(field.Type) && !CanBeAutoCreated(node, field)) || IsValueField(field);
}
示例4: OverrideOrNewModifier
protected static string OverrideOrNewModifier(Field field)
{
return IsOverride(field) ? "override " : IsNew(field) ? "new " : "";
}
示例5: IsAutoCreatableToken
private bool IsAutoCreatableToken(Node node, Field field)
{
return field.Type == "SyntaxToken"
&& field.Kinds != null
&& ((field.Kinds.Count == 1 && field.Kinds[0].Name != "IdentifierToken" && !field.Kinds[0].Name.EndsWith("LiteralToken", StringComparison.Ordinal)) || (field.Kinds.Count > 1 && field.Kinds.Count == node.Kinds.Count));
}
示例6: CanAutoConvertFromString
private bool CanAutoConvertFromString(Field field)
{
return IsIdentifierToken(field) || IsIdentifierNameSyntax(field);
}
示例7: IsIdentifierNameSyntax
private bool IsIdentifierNameSyntax(Field field)
{
return field.Type == "IdentifierNameSyntax";
}
示例8: IsNew
protected static bool IsNew(Field f)
{
return f.New != null && string.Compare(f.New, "true", true) == 0;
}
示例9: ChooseValidKind
//guess a reasonable kind if there are no constraints
private static string ChooseValidKind(Field field)
{
return field.Kinds.Any() ? field.Kinds[0].Name : "IdentifierToken";
}
示例10: IsOverride
protected static bool IsOverride(Field f)
{
return f.Override != null && string.Compare(f.Override, "true", true) == 0;
}
示例11: IsInternal
protected static bool IsInternal(Field f)
{
return f.Internal != null && string.Compare(f.Internal, "true", true) == 0;
}
示例12: GetFieldType
protected static string GetFieldType(Field field)
{
if (IsAnyList(field.Type))
return "CSharpSyntaxNode";
return field.Type;
}
示例13: CanBeField
protected static bool CanBeField(Field field)
{
return field.Type != "SyntaxToken" && !IsAnyList(field.Type) && !IsOverride(field) && !IsNew(field);
}
示例14: AccessibilityModifier
protected static string AccessibilityModifier(Field field)
{
return IsInternal(field) ? "internal" : "public";
}
示例15: GetRedPropertyType
private string GetRedPropertyType(Field field)
{
if (field.Type == "SyntaxList<SyntaxToken>")
return "SyntaxTokenList";
return field.Type;
}