/// <summary>
        /// Creates an event symbol that can be used to describe an event declaration.
        /// </summary>
        public static IEventSymbol CreateEventSymbol(
            ImmutableArray <AttributeData> attributes, Accessibility accessibility,
            DeclarationModifiers modifiers, ITypeSymbol type,
            ImmutableArray <IEventSymbol> explicitInterfaceImplementations,
            string name,
            IMethodSymbol addMethod    = null,
            IMethodSymbol removeMethod = null,
            IMethodSymbol raiseMethod  = null)
        {
            var result = new CodeGenerationEventSymbol(null, attributes, accessibility, modifiers, type, explicitInterfaceImplementations, name, addMethod, removeMethod, raiseMethod);

            CodeGenerationEventInfo.Attach(result, modifiers.IsUnsafe);
            return(result);
        }
Exemplo n.º 2
0
 private static bool GetIsUnsafe(CodeGenerationEventInfo info)
 {
     return(info != null && info._isUnsafe);
 }
Exemplo n.º 3
0
        public static void Attach(IEventSymbol @event, bool isUnsafe)
        {
            var info = new CodeGenerationEventInfo(isUnsafe);

            s_eventToInfoMap.Add(@event, info);
        }
Exemplo n.º 4
0
 private static bool GetIsUnsafe(CodeGenerationEventInfo info)
 {
     return info != null && info._isUnsafe;
 }
Exemplo n.º 5
0
 public static void Attach(IEventSymbol @event, bool isUnsafe)
 {
     var info = new CodeGenerationEventInfo(isUnsafe);
     s_eventToInfoMap.Add(@event, info);
 }