示例#1
0
 public static void Attach(
     IFieldSymbol field,
     bool isUnsafe,
     bool isWithEvents,
     SyntaxNode initializer)
 {
     var info = new CodeGenerationFieldInfo(isUnsafe, isWithEvents, initializer);
     fieldToInfoMap.Add(field, info);
 }
示例#2
0
        /// <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);
        }
示例#3
0
 private static SyntaxNode GetInitializer(CodeGenerationFieldInfo info)
 {
     return info == null ? null : info.initializer;
 }
示例#4
0
 private static bool GetIsWithEvents(CodeGenerationFieldInfo info)
 {
     return info != null && info.isWithEvents;
 }
示例#5
0
 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);
 }
示例#9
0
 private static SyntaxNode GetInitializer(CodeGenerationFieldInfo info)
 => info?._initializer;
示例#10
0
 private static bool GetIsUnsafe(CodeGenerationFieldInfo info)
 => info != null && info._isUnsafe;