コード例 #1
0
        /// <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);
        }
コード例 #2
0
 private static bool GetIsUnsafe(CodeGenerationEventInfo info)
 {
     return(info != null && info._isUnsafe);
 }
コード例 #3
0
        public static void Attach(IEventSymbol @event, bool isUnsafe)
        {
            var info = new CodeGenerationEventInfo(isUnsafe);

            s_eventToInfoMap.Add(@event, info);
        }