public ProxyEventImplementation(string name, Type declaringType, Type handlerType, MemberAccessType access) { this.name = name; this.declaringType = declaringType; this.handlerType = handlerType; this.access = access; }
public AttachedEventImplementation(string name, MethodInfo addMethod) { this.name = name; this.addMethod = addMethod; ParameterInfo[] parameters = PlatformTypeHelper.GetParameters(this.addMethod); if (parameters != null && (int)parameters.Length == 2) { this.targetType = parameters[0].ParameterType; this.handlerType = parameters[1].ParameterType; } this.access = PlatformTypeHelper.GetMemberAccess(this.addMethod); }
public static bool IsPropertyWritable(ITypeResolver typeResolver, IProperty propertyKey, bool allowProtectedProperties) { MemberAccessTypes allowableMemberAccess = TypeHelper.GetAllowableMemberAccess(typeResolver, propertyKey.DeclaringType); if (allowProtectedProperties && !propertyKey.IsAttachable || typeResolver.IsCapabilitySet(PlatformCapability.WorkaroundSL12782) && typeResolver.PlatformMetadata.KnownTypes.UserControl.IsAssignableFrom(propertyKey.DeclaringTypeId) && propertyKey.Equals((object)propertyKey.DeclaringType.Metadata.DefaultContentProperty)) { allowableMemberAccess |= MemberAccessTypes.Protected; } MemberAccessType writeAccess = propertyKey.WriteAccess; return(TypeHelper.IsSet(allowableMemberAccess, writeAccess)); }
public LocalEventImplementation(System.Reflection.EventInfo eventInfo) { this.eventInfo = eventInfo; this.addMethod = this.eventInfo.GetAddMethod(true); this.access = (this.addMethod != null ? PlatformTypeHelper.GetMemberAccess(this.addMethod) : MemberAccessType.Private); }
public static bool IsSet(MemberAccessTypes accessTypes, MemberAccessType accessType) { return((accessTypes & (MemberAccessTypes)accessType) != MemberAccessTypes.None); }