コード例 #1
0
 internal static bool IsDefined(RuntimeConstructorInfo ctor, RuntimeType caType)
 {
     if (PseudoCustomAttribute.IsDefined(ctor, caType))
     {
         return(true);
     }
     return(CustomAttribute.IsCustomAttributeDefined(ctor.GetRuntimeModule(), ctor.MetadataToken, caType));
 }
コード例 #2
0
        internal static object[] GetCustomAttributes(RuntimeConstructorInfo ctor, RuntimeType caType)
        {
            int num = 0;

            Attribute[] customAttributes  = PseudoCustomAttribute.GetCustomAttributes(ctor, caType, true, out num);
            object[]    customAttributes2 = CustomAttribute.GetCustomAttributes(ctor.GetRuntimeModule(), ctor.MetadataToken, num, caType, !CustomAttribute.AllowCriticalCustomAttributes(ctor));
            if (num > 0)
            {
                Array.Copy(customAttributes, 0, customAttributes2, customAttributes2.Length - num, num);
            }
            return(customAttributes2);
        }
コード例 #3
0
        internal static object[] GetCustomAttributes(RuntimeConstructorInfo ctor, RuntimeType caType)
        {
            int count = 0;

            Attribute[] customAttributes1 = PseudoCustomAttribute.GetCustomAttributes(ctor, caType, true, out count);
            object[]    customAttributes2 = CustomAttribute.GetCustomAttributes(ctor.GetRuntimeModule(), ctor.MetadataToken, count, caType, !CustomAttribute.AllowCriticalCustomAttributes((MethodBase)ctor));
            if (count > 0)
            {
                Array.Copy((Array)customAttributes1, 0, (Array)customAttributes2, customAttributes2.Length - count, count);
            }
            return(customAttributes2);
        }
コード例 #4
0
        internal static object[] GetCustomAttributes(RuntimeConstructorInfo ctor, RuntimeType caType)
        {
            int count = 0;

            Attribute[] sourceArray      = PseudoCustomAttribute.GetCustomAttributes(ctor, caType, true, out count);
            object[]    destinationArray = GetCustomAttributes(ctor.GetRuntimeModule(), ctor.MetadataToken, count, caType, !AllowCriticalCustomAttributes(ctor));
            if (count > 0)
            {
                Array.Copy(sourceArray, 0, destinationArray, destinationArray.Length - count, count);
            }
            return(destinationArray);
        }
コード例 #5
0
        // 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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        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(RuntimeConstructorInfo target)
 {
     return GetCustomAttributes(target.GetRuntimeModule(), target.MetadataToken);
 }
コード例 #9
0
ファイル: CustomAttribute.cs プロジェクト: enavro/coreclr
        [System.Security.SecuritySafeCritical]  // auto-generated
        internal static Object[] GetCustomAttributes(RuntimeConstructorInfo ctor, RuntimeType caType)
        {
            Contract.Requires(ctor != null);
            Contract.Requires(caType != null);

            int pcaCount = 0;
            Attribute[] pca = PseudoCustomAttribute.GetCustomAttributes(ctor, caType, true, out pcaCount);
            object[] attributes = GetCustomAttributes(ctor.GetRuntimeModule(), ctor.MetadataToken, pcaCount, caType, !AllowCriticalCustomAttributes(ctor));
            if (pcaCount > 0) Array.Copy(pca, 0, attributes, attributes.Length - pcaCount, pcaCount);
            return attributes;
        }
コード例 #10
0
ファイル: CustomAttribute.cs プロジェクト: enavro/coreclr
        [System.Security.SecurityCritical]  // auto-generated
        internal static bool IsDefined(RuntimeConstructorInfo ctor, RuntimeType caType)
        {
            Contract.Requires(ctor != null);
            Contract.Requires(caType != null);

            if (PseudoCustomAttribute.IsDefined(ctor, caType))
                return true;

            return IsCustomAttributeDefined(ctor.GetRuntimeModule(), ctor.MetadataToken, caType);
        }
コード例 #11
0
 internal static IList <CustomAttributeData> GetCustomAttributesInternal(RuntimeConstructorInfo target)
 {
     return(CustomAttributeData.GetCustomAttributes(target.GetRuntimeModule(), target.MetadataToken));
 }
コード例 #12
0
        [System.Security.SecurityCritical]  // auto-generated
        internal static bool IsDefined(RuntimeConstructorInfo ctor, RuntimeType caType)
        {
            Contract.Requires(ctor != 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(ctor, caType))
                return true;

            return IsCustomAttributeDefined(ctor.GetRuntimeModule(), ctor.MetadataToken, caType);
        }
コード例 #13
0
 internal static bool IsDefined(RuntimeConstructorInfo ctor, RuntimeType caType)
 {
     return (PseudoCustomAttribute.IsDefined(ctor, caType) || IsCustomAttributeDefined(ctor.GetRuntimeModule(), ctor.MetadataToken, caType));
 }
コード例 #14
0
 internal static object[] GetCustomAttributes(RuntimeConstructorInfo ctor, RuntimeType caType)
 {
     int count = 0;
     Attribute[] sourceArray = PseudoCustomAttribute.GetCustomAttributes(ctor, caType, true, out count);
     object[] destinationArray = GetCustomAttributes(ctor.GetRuntimeModule(), ctor.MetadataToken, count, caType, !AllowCriticalCustomAttributes(ctor));
     if (count > 0)
     {
         Array.Copy(sourceArray, 0, destinationArray, destinationArray.Length - count, count);
     }
     return destinationArray;
 }