public static void Attach( IFieldSymbol field, bool isUnsafe, bool isWithEvents, SyntaxNode initializer) { var info = new CodeGenerationFieldInfo(isUnsafe, isWithEvents, initializer); fieldToInfoMap.Add(field, info); }
/// <summary> /// Creates a field symbol that can be used to describe a field declaration. /// </summary> public static IFieldSymbol CreateFieldSymbol( ImmutableArray <AttributeData> attributes, Accessibility accessibility, DeclarationModifiers modifiers, ITypeSymbol type, string name, bool hasConstantValue = false, object constantValue = null, SyntaxNode initializer = null) { var result = new CodeGenerationFieldSymbol(null, attributes, accessibility, modifiers, type, name, hasConstantValue, constantValue); CodeGenerationFieldInfo.Attach(result, modifiers.IsUnsafe, modifiers.IsWithEvents, initializer); return(result); }
private static SyntaxNode GetInitializer(CodeGenerationFieldInfo info) { return info == null ? null : info.initializer; }
private static bool GetIsWithEvents(CodeGenerationFieldInfo info) { return info != null && info.isWithEvents; }
private static bool GetIsUnsafe(CodeGenerationFieldInfo info) { return info != null && info.isUnsafe; }
private static SyntaxNode GetInitializer(CodeGenerationFieldInfo info) { return(info == null ? null : info._initializer); }
private static bool GetIsWithEvents(CodeGenerationFieldInfo info) { return(info != null && info._isWithEvents); }
private static bool GetIsUnsafe(CodeGenerationFieldInfo info) { return(info != null && info._isUnsafe); }
private static SyntaxNode GetInitializer(CodeGenerationFieldInfo info) => info?._initializer;
private static bool GetIsUnsafe(CodeGenerationFieldInfo info) => info != null && info._isUnsafe;