Ejemplo n.º 1
0
        // NOTE: May be called on invalid definitions
        public override bool EventAlwaysUsed(CST.AssemblyDef assemblyDef, CST.TypeDef typeDef, CST.EventDef eventDef)
        {
#if false
            if (env.AttributeHelper.EventHasAttribute
                    (assemblyDef, typeDef, eventDef, env.Global.CompilerGeneratedAttributeRef, false))
            {
                return(false);
            }
#endif

            if (env.AttributeHelper.EventHasAttribute
                    (assemblyDef, typeDef, eventDef, env.AttributeHelper.IgnoreAttributeRef, true, true))
            {
                return(false);
            }

            if (HasFullReflection(assemblyDef, typeDef))
            {
                return(true);
            }

            var isUsed = default(bool);
            env.AttributeHelper.GetValueFromEvent
                (assemblyDef,
                typeDef,
                eventDef,
                env.AttributeHelper.UsedAttributeRef,
                env.AttributeHelper.TheIsUsedProperty,
                true,
                false,
                ref isUsed);
            if (isUsed)
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
 public abstract bool EventAlwaysUsed(AssemblyDef assemblyDef, TypeDef typeDef, EventDef eventDef);
Ejemplo n.º 3
0
 public string ResolveEventDefToSlot(CST.AssemblyDef assemblyDef, CST.TypeDef typeDef, CST.EventDef eventDef)
 {
     return(TypeMappingFor(assemblyDef, typeDef).ResolveEventToSlot
                (eventDef.QualifiedMemberName(env.Global, assemblyDef, typeDef)));
 }