internal static object[] GetCustomAttributes(RuntimePropertyInfo property, RuntimeType caType) { int count = 0; Attribute[] customAttributes1 = PseudoCustomAttribute.GetCustomAttributes(property, caType, out count); bool isDecoratedTargetSecurityTransparent = property.GetRuntimeModule().GetRuntimeAssembly().IsAllSecurityTransparent(); object[] customAttributes2 = CustomAttribute.GetCustomAttributes(property.GetRuntimeModule(), property.MetadataToken, count, caType, isDecoratedTargetSecurityTransparent); if (count > 0) { Array.Copy((Array)customAttributes1, 0, (Array)customAttributes2, customAttributes2.Length - count, count); } return(customAttributes2); }
internal static object[] GetCustomAttributes(RuntimePropertyInfo property, RuntimeType caType) { int count = 0; Attribute[] sourceArray = PseudoCustomAttribute.GetCustomAttributes(property, caType, out count); bool isDecoratedTargetSecurityTransparent = property.GetRuntimeModule().GetRuntimeAssembly().IsAllSecurityTransparent(); object[] destinationArray = GetCustomAttributes(property.GetRuntimeModule(), property.MetadataToken, count, caType, isDecoratedTargetSecurityTransparent); if (count > 0) { Array.Copy(sourceArray, 0, destinationArray, destinationArray.Length - count, count); } return(destinationArray); }
internal static bool IsDefined(RuntimePropertyInfo property, RuntimeType caType) { if (PseudoCustomAttribute.IsDefined(property, caType)) { return(true); } return(CustomAttribute.IsCustomAttributeDefined(property.GetRuntimeModule(), property.MetadataToken, caType)); }
// Token: 0x0600471F RID: 18207 RVA: 0x00102024 File Offset: 0x00100224 internal RuntimeModule GetRuntimeModule() { RuntimeMethodInfo runtimeMethodInfo = this.Member as RuntimeMethodInfo; RuntimeConstructorInfo runtimeConstructorInfo = this.Member as RuntimeConstructorInfo; RuntimePropertyInfo runtimePropertyInfo = this.Member as RuntimePropertyInfo; if (runtimeMethodInfo != null) { return(runtimeMethodInfo.GetRuntimeModule()); } if (runtimeConstructorInfo != null) { return(runtimeConstructorInfo.GetRuntimeModule()); } if (runtimePropertyInfo != null) { return(runtimePropertyInfo.GetRuntimeModule()); } return(null); }
internal RuntimeModule GetRuntimeModule() { RuntimeMethodInfo member = this.Member as RuntimeMethodInfo; RuntimeConstructorInfo info2 = this.Member as RuntimeConstructorInfo; RuntimePropertyInfo info3 = this.Member as RuntimePropertyInfo; if (member != null) { return(member.GetRuntimeModule()); } if (info2 != null) { return(info2.GetRuntimeModule()); } if (info3 != null) { return(info3.GetRuntimeModule()); } return(null); }
internal RuntimeModule GetRuntimeModule() { RuntimeMethodInfo method = Member as RuntimeMethodInfo; RuntimeConstructorInfo constructor = Member as RuntimeConstructorInfo; RuntimePropertyInfo property = Member as RuntimePropertyInfo; if (method != null) { return(method.GetRuntimeModule()); } else if (constructor != null) { return(constructor.GetRuntimeModule()); } else if (property != null) { return(property.GetRuntimeModule()); } else { return(null); } }
internal static IList<CustomAttributeData> GetCustomAttributesInternal(RuntimePropertyInfo target) { return GetCustomAttributes(target.GetRuntimeModule(), target.MetadataToken); }
[System.Security.SecuritySafeCritical] // auto-generated internal static Object[] GetCustomAttributes(RuntimePropertyInfo property, RuntimeType caType) { Contract.Requires(property != null); Contract.Requires(caType != null); int pcaCount = 0; Attribute[] pca = PseudoCustomAttribute.GetCustomAttributes(property, caType, out pcaCount); // Since properties and events have no transparency state, logically we should check the declaring types. // But then if someone wanted to apply critical attributes on a property/event he would need to make the type critical, // which would also implicitly made all the members critical. // So we check the containing assembly instead. If the assembly can contain critical code we allow critical attributes on properties/events. bool disallowCriticalCustomAttributes = property.GetRuntimeModule().GetRuntimeAssembly().IsAllSecurityTransparent(); object[] attributes = GetCustomAttributes(property.GetRuntimeModule(), property.MetadataToken, pcaCount, caType, disallowCriticalCustomAttributes); if (pcaCount > 0) Array.Copy(pca, 0, attributes, attributes.Length - pcaCount, pcaCount); return attributes; }
[System.Security.SecurityCritical] // auto-generated internal static bool IsDefined(RuntimePropertyInfo property, RuntimeType caType) { Contract.Requires(property != null); Contract.Requires(caType != null); if (PseudoCustomAttribute.IsDefined(property, caType)) return true; return IsCustomAttributeDefined(property.GetRuntimeModule(), property.MetadataToken, caType); }
internal static IList <CustomAttributeData> GetCustomAttributesInternal(RuntimePropertyInfo target) { return(CustomAttributeData.GetCustomAttributes(target.GetRuntimeModule(), target.MetadataToken)); }
[System.Security.SecurityCritical] // auto-generated internal static bool IsDefined(RuntimePropertyInfo property, RuntimeType caType) { Contract.Requires(property != null); Contract.Requires(caType != null); #if !FEATURE_CORECLR if (FrameworkEventSource.IsInitialized && FrameworkEventSource.Log.IsEnabled(EventLevel.Informational, FrameworkEventSource.Keywords.DynamicTypeUsage) && caType != null) { FrameworkEventSource.Log.QueryAttributeIsDefined(caType.GetFullNameForEtw()); } #endif if (PseudoCustomAttribute.IsDefined(property, caType)) return true; return IsCustomAttributeDefined(property.GetRuntimeModule(), property.MetadataToken, caType); }
internal static bool IsDefined(RuntimePropertyInfo property, RuntimeType caType) { return (PseudoCustomAttribute.IsDefined(property, caType) || IsCustomAttributeDefined(property.GetRuntimeModule(), property.MetadataToken, caType)); }
internal static object[] GetCustomAttributes(RuntimePropertyInfo property, RuntimeType caType) { int count = 0; Attribute[] sourceArray = PseudoCustomAttribute.GetCustomAttributes(property, caType, out count); bool isDecoratedTargetSecurityTransparent = property.GetRuntimeModule().GetRuntimeAssembly().IsAllSecurityTransparent(); object[] destinationArray = GetCustomAttributes(property.GetRuntimeModule(), property.MetadataToken, count, caType, isDecoratedTargetSecurityTransparent); if (count > 0) { Array.Copy(sourceArray, 0, destinationArray, destinationArray.Length - count, count); } return destinationArray; }