当前位置: 首页>>代码示例>>C#>>正文


C# RuntimeParameterInfo.GetRuntimeModule方法代码示例

本文整理汇总了C#中System.Reflection.RuntimeParameterInfo.GetRuntimeModule方法的典型用法代码示例。如果您正苦于以下问题:C# RuntimeParameterInfo.GetRuntimeModule方法的具体用法?C# RuntimeParameterInfo.GetRuntimeModule怎么用?C# RuntimeParameterInfo.GetRuntimeModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Reflection.RuntimeParameterInfo的用法示例。


在下文中一共展示了RuntimeParameterInfo.GetRuntimeModule方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetCustomAttributesInternal

 internal static IList<CustomAttributeData> GetCustomAttributesInternal(RuntimeParameterInfo target)
 {
     IList<CustomAttributeData> customAttributes = GetCustomAttributes(target.GetRuntimeModule(), target.MetadataToken);
     int count = 0;
     Attribute[] attributeArray = PseudoCustomAttribute.GetCustomAttributes(target, typeof(object) as RuntimeType, out count);
     if (count == 0)
     {
         return customAttributes;
     }
     CustomAttributeData[] array = new CustomAttributeData[customAttributes.Count + count];
     customAttributes.CopyTo(array, count);
     for (int i = 0; i < count; i++)
     {
         array[i] = new CustomAttributeData(attributeArray[i]);
     }
     return Array.AsReadOnly<CustomAttributeData>(array);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:17,代码来源:CustomAttributeData.cs

示例2: GetCustomAttributesInternal

        [System.Security.SecuritySafeCritical]  // auto-generated
        internal static IList<CustomAttributeData> GetCustomAttributesInternal(RuntimeParameterInfo target)
        {
            Contract.Assert(target != null);

            IList<CustomAttributeData> cad = GetCustomAttributes(target.GetRuntimeModule(), target.MetadataToken);

            int pcaCount = 0;
            Attribute[] a = PseudoCustomAttribute.GetCustomAttributes(target, typeof(object) as RuntimeType, out pcaCount);

            if (pcaCount == 0)
                return cad;

            CustomAttributeData[] pca = new CustomAttributeData[cad.Count + pcaCount];
            cad.CopyTo(pca, pcaCount);
            for (int i = 0; i < pcaCount; i++)
                pca[i] = new CustomAttributeData(a[i]);

            return Array.AsReadOnly(pca);
        }
开发者ID:enavro,项目名称:coreclr,代码行数:20,代码来源:CustomAttribute.cs

示例3: GetCustomAttribute

 [System.Security.SecurityCritical]  // auto-generated
 internal static Attribute GetCustomAttribute(RuntimeParameterInfo parameter)
 {
     return GetCustomAttribute(parameter.MetadataToken, parameter.GetRuntimeModule());
 }
开发者ID:razzfazz,项目名称:mono,代码行数:5,代码来源:attributes.cs

示例4: GetCustomAttributes

        [System.Security.SecuritySafeCritical]  // auto-generated
        internal static Object[] GetCustomAttributes(RuntimeParameterInfo parameter, RuntimeType caType)
        {
            Contract.Requires(parameter != null);
            Contract.Requires(caType != null);

            int pcaCount = 0;
            Attribute[] pca = PseudoCustomAttribute.GetCustomAttributes(parameter, caType, out pcaCount);
            object[] attributes = GetCustomAttributes(parameter.GetRuntimeModule(), parameter.MetadataToken, pcaCount, caType, !AllowCriticalCustomAttributes(parameter)); 
            if (pcaCount > 0) Array.Copy(pca, 0, attributes, attributes.Length - pcaCount, pcaCount);
            return attributes;
        }
开发者ID:enavro,项目名称:coreclr,代码行数:12,代码来源:CustomAttribute.cs

示例5: IsDefined

        [System.Security.SecurityCritical]  // auto-generated
        internal static bool IsDefined(RuntimeParameterInfo parameter, RuntimeType caType)
        {
            Contract.Requires(parameter != null);
            Contract.Requires(caType != null);

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

            return IsCustomAttributeDefined(parameter.GetRuntimeModule(), parameter.MetadataToken, caType);
        }
开发者ID:enavro,项目名称:coreclr,代码行数:11,代码来源:CustomAttribute.cs

示例6: IsDefined

        [System.Security.SecurityCritical]  // auto-generated
        internal static bool IsDefined(RuntimeParameterInfo parameter, RuntimeType caType)
        {
            Contract.Requires(parameter != 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(parameter, caType))
                return true;

            return IsCustomAttributeDefined(parameter.GetRuntimeModule(), parameter.MetadataToken, caType);
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:18,代码来源:CustomAttribute.cs

示例7: IsDefined

 internal static bool IsDefined(RuntimeParameterInfo parameter, RuntimeType caType)
 {
     return (PseudoCustomAttribute.IsDefined(parameter, caType) || IsCustomAttributeDefined(parameter.GetRuntimeModule(), parameter.MetadataToken, caType));
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:4,代码来源:CustomAttribute.cs

示例8: GetCustomAttributes

 internal static object[] GetCustomAttributes(RuntimeParameterInfo parameter, RuntimeType caType)
 {
     int count = 0;
     Attribute[] sourceArray = PseudoCustomAttribute.GetCustomAttributes(parameter, caType, out count);
     object[] destinationArray = GetCustomAttributes(parameter.GetRuntimeModule(), parameter.MetadataToken, count, caType, !AllowCriticalCustomAttributes(parameter));
     if (count > 0)
     {
         Array.Copy(sourceArray, 0, destinationArray, destinationArray.Length - count, count);
     }
     return destinationArray;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:CustomAttribute.cs


注:本文中的System.Reflection.RuntimeParameterInfo.GetRuntimeModule方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。