internal static object[] GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) { int count = 0; Attribute[] customAttributes1 = PseudoCustomAttribute.GetCustomAttributes(assembly, caType, true, out count); int token = RuntimeAssembly.GetToken(assembly.GetNativeHandle()); bool isDecoratedTargetSecurityTransparent = assembly.IsAllSecurityTransparent(); object[] customAttributes2 = CustomAttribute.GetCustomAttributes(assembly.ManifestModule as RuntimeModule, token, count, caType, isDecoratedTargetSecurityTransparent); if (count > 0) { Array.Copy((Array)customAttributes1, 0, (Array)customAttributes2, customAttributes2.Length - count, count); } return(customAttributes2); }
[System.Security.SecuritySafeCritical] // auto-generated internal static Object[] GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) { Contract.Requires(assembly != null); Contract.Requires(caType != null); int pcaCount = 0; Attribute[] pca = PseudoCustomAttribute.GetCustomAttributes(assembly, caType, true, out pcaCount); int assemblyToken = RuntimeAssembly.GetToken(assembly.GetNativeHandle()); bool isAssemblySecurityTransparent = assembly.IsAllSecurityTransparent(); object[] attributes = GetCustomAttributes(assembly.ManifestModule as RuntimeModule, assemblyToken, pcaCount, caType, isAssemblySecurityTransparent); if (pcaCount > 0) Array.Copy(pca, 0, attributes, attributes.Length - pcaCount, pcaCount); return attributes; }
internal static object[] GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) { int count = 0; Attribute[] sourceArray = PseudoCustomAttribute.GetCustomAttributes(assembly, caType, true, out count); int token = RuntimeAssembly.GetToken(assembly.GetNativeHandle()); bool isDecoratedTargetSecurityTransparent = assembly.IsAllSecurityTransparent(); object[] destinationArray = GetCustomAttributes(assembly.ManifestModule as RuntimeModule, token, count, caType, isDecoratedTargetSecurityTransparent); if (count > 0) { Array.Copy(sourceArray, 0, destinationArray, destinationArray.Length - count, count); } return destinationArray; }