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


C# Reflection.RuntimeParameterInfo类代码示例

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


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

示例1: GetCustomAttribute

 internal static Attribute GetCustomAttribute(RuntimeParameterInfo parameter)
 {
     if (!parameter.IsOptional)
     {
         return null;
     }
     return new OptionalAttribute();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:OptionalAttribute.cs

示例2: RuntimeParameterInfo

 private RuntimeParameterInfo(RuntimeParameterInfo accessor, MemberInfo member)
 {
     base.MemberImpl = member;
     this.m_originalMember = accessor.MemberImpl as MethodBase;
     base.NameImpl = accessor.Name;
     this.m_nameIsCached = true;
     base.ClassImpl = accessor.ParameterType;
     base.PositionImpl = accessor.Position;
     base.AttrsImpl = accessor.Attributes;
     this.m_tkParamDef = System.Reflection.MetadataToken.IsNullToken(accessor.MetadataToken) ? 0x8000000 : accessor.MetadataToken;
     this.m_scope = accessor.m_scope;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:12,代码来源:RuntimeParameterInfo.cs

示例3: GetCustomAttributes

 internal static Attribute[] GetCustomAttributes(RuntimeParameterInfo parameter, RuntimeType caType, out int count)
 {
     count = 0;
     bool flag = (caType == ((RuntimeType) typeof(object))) || (caType == ((RuntimeType) typeof(Attribute)));
     if (!flag && (s_pca.GetValueOrDefault(caType) == null))
     {
         return null;
     }
     Attribute[] attributeArray = new Attribute[s_pcasCount];
     Attribute customAttribute = null;
     if (flag || (caType == ((RuntimeType) typeof(InAttribute))))
     {
         customAttribute = InAttribute.GetCustomAttribute(parameter);
         if (customAttribute != null)
         {
             attributeArray[count++] = customAttribute;
         }
     }
     if (flag || (caType == ((RuntimeType) typeof(OutAttribute))))
     {
         customAttribute = OutAttribute.GetCustomAttribute(parameter);
         if (customAttribute != null)
         {
             attributeArray[count++] = customAttribute;
         }
     }
     if (flag || (caType == ((RuntimeType) typeof(OptionalAttribute))))
     {
         customAttribute = OptionalAttribute.GetCustomAttribute(parameter);
         if (customAttribute != null)
         {
             attributeArray[count++] = customAttribute;
         }
     }
     if (flag || (caType == ((RuntimeType) typeof(MarshalAsAttribute))))
     {
         customAttribute = MarshalAsAttribute.GetCustomAttribute(parameter);
         if (customAttribute != null)
         {
             attributeArray[count++] = customAttribute;
         }
     }
     return attributeArray;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:44,代码来源:PseudoCustomAttribute.cs

示例4: IsDefined

 internal static bool IsDefined(RuntimeParameterInfo parameter, RuntimeType caType)
 {
     bool flag = (caType == ((RuntimeType) typeof(object))) || (caType == ((RuntimeType) typeof(Attribute)));
     if (!flag && (s_pca.GetValueOrDefault(caType) == null))
     {
         return false;
     }
     return (((flag || (caType == ((RuntimeType) typeof(InAttribute)))) && InAttribute.IsDefined(parameter)) || (((flag || (caType == ((RuntimeType) typeof(OutAttribute)))) && OutAttribute.IsDefined(parameter)) || (((flag || (caType == ((RuntimeType) typeof(OptionalAttribute)))) && OptionalAttribute.IsDefined(parameter)) || ((flag || (caType == ((RuntimeType) typeof(MarshalAsAttribute)))) && MarshalAsAttribute.IsDefined(parameter)))));
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:PseudoCustomAttribute.cs

示例5: GetReflectionCachedData

        }// GetCachedRemotingAttribute
 
        internal static RemotingCachedData GetReflectionCachedData(RuntimeParameterInfo reflectionObject) 
        {
            RemotingCachedData cache = null; 
            cache = (RemotingCachedData)reflectionObject.RemotingCache[CacheObjType.RemotingData];
            if (cache == null)
            {
                cache = new RemotingCachedData(reflectionObject); 
                reflectionObject.RemotingCache[CacheObjType.RemotingData] = cache;
            } 
 
            return cache;
        } // GetCachedRemotingAttribute 
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:14,代码来源:RemotingServices.cs

示例6: RuntimeParameterInfo

 // used by RuntimePropertyInfo
 internal RuntimeParameterInfo(RuntimeParameterInfo accessor, RuntimePropertyInfo property)
     : this(accessor, (MemberInfo)property)
 {
     m_signature = property.Signature;
 }
开发者ID:uQr,项目名称:referencesource,代码行数:6,代码来源:parameterinfo.cs

示例7: 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

示例8: GetCustomAttribute

 internal static Attribute GetCustomAttribute(RuntimeParameterInfo parameter)
 {
     return parameter.IsOptional ? new OptionalAttribute() : null;
 }
开发者ID:razzfazz,项目名称:mono,代码行数:4,代码来源:attributes.cs

示例9: IsDefined

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

示例10: IsDefined

        [System.Security.SecurityCritical]  // auto-generated
        internal static bool IsDefined(RuntimeParameterInfo parameter, RuntimeType caType)
        {
            bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
            if (!all && s_pca.GetValueOrDefault(caType) == null)
                return false;


            if (all || caType == (RuntimeType)typeof(InAttribute))
            {
                if (InAttribute.IsDefined(parameter)) return true;
            }
            if (all || caType == (RuntimeType)typeof(OutAttribute))
            {
                if (OutAttribute.IsDefined(parameter)) return true;
            }
            if (all || caType == (RuntimeType)typeof(OptionalAttribute))
            {
                if (OptionalAttribute.IsDefined(parameter)) return true;
            }
            if (all || caType == (RuntimeType)typeof(MarshalAsAttribute))
            {
                if (MarshalAsAttribute.IsDefined(parameter)) return true;
            }

            return false;
        }
开发者ID:enavro,项目名称:coreclr,代码行数:27,代码来源:CustomAttribute.cs

示例11: 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

示例12: GetReflectionCachedData

 internal static RemotingCachedData GetReflectionCachedData(RuntimeParameterInfo reflectionObject)
 {
     return reflectionObject.RemotingCache;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:4,代码来源:remotingservices.cs

示例13: GetIndexParametersNoCopy

 internal ParameterInfo[] GetIndexParametersNoCopy()
 {
     if (this.m_parameters == null)
     {
         int length = 0;
         ParameterInfo[] parametersNoCopy = null;
         MethodInfo getMethod = this.GetGetMethod(true);
         if (getMethod != null)
         {
             parametersNoCopy = getMethod.GetParametersNoCopy();
             length = parametersNoCopy.Length;
         }
         else
         {
             getMethod = this.GetSetMethod(true);
             if (getMethod != null)
             {
                 parametersNoCopy = getMethod.GetParametersNoCopy();
                 length = parametersNoCopy.Length - 1;
             }
         }
         ParameterInfo[] infoArray2 = new ParameterInfo[length];
         for (int i = 0; i < length; i++)
         {
             infoArray2[i] = new RuntimeParameterInfo((RuntimeParameterInfo) parametersNoCopy[i], this);
         }
         this.m_parameters = infoArray2;
     }
     return this.m_parameters;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:30,代码来源:RuntimePropertyInfo.cs

示例14: GetParameters

 internal static unsafe ParameterInfo[] GetParameters(IRuntimeMethodInfo methodHandle, MemberInfo member, Signature sig, out ParameterInfo returnParameter, bool fetchReturnParameter)
 {
     returnParameter = null;
     int length = sig.Arguments.Length;
     ParameterInfo[] infoArray = fetchReturnParameter ? null : new ParameterInfo[length];
     int methodDef = RuntimeMethodHandle.GetMethodDef(methodHandle);
     int count = 0;
     if (!System.Reflection.MetadataToken.IsNullToken(methodDef))
     {
         MetadataImport metadataImport = RuntimeTypeHandle.GetMetadataImport(RuntimeMethodHandle.GetDeclaringType(methodHandle));
         count = metadataImport.EnumParamsCount(methodDef);
         int* result = (int*) stackalloc byte[(((IntPtr) count) * 4)];
         metadataImport.EnumParams(methodDef, result, count);
         if (count > (length + 1))
         {
             throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ParameterSignatureMismatch"));
         }
         for (uint i = 0; i < count; i++)
         {
             ParameterAttributes attributes;
             int num5;
             int parameterToken = result[(int) ((int*) i)];
             metadataImport.GetParamDefProps(parameterToken, out num5, out attributes);
             num5--;
             if (fetchReturnParameter && (num5 == -1))
             {
                 if (returnParameter != null)
                 {
                     throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ParameterSignatureMismatch"));
                 }
                 returnParameter = new RuntimeParameterInfo(sig, metadataImport, parameterToken, num5, attributes, member);
             }
             else if (!fetchReturnParameter && (num5 >= 0))
             {
                 if (num5 >= length)
                 {
                     throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ParameterSignatureMismatch"));
                 }
                 infoArray[num5] = new RuntimeParameterInfo(sig, metadataImport, parameterToken, num5, attributes, member);
             }
         }
     }
     if (fetchReturnParameter)
     {
         if (returnParameter == null)
         {
             returnParameter = new RuntimeParameterInfo(sig, MetadataImport.EmptyImport, 0, -1, ParameterAttributes.None, member);
         }
         return infoArray;
     }
     if (count < (infoArray.Length + 1))
     {
         for (int j = 0; j < infoArray.Length; j++)
         {
             if (infoArray[j] == null)
             {
                 infoArray[j] = new RuntimeParameterInfo(sig, MetadataImport.EmptyImport, 0, j, ParameterAttributes.None, member);
             }
         }
     }
     return infoArray;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:62,代码来源:RuntimeParameterInfo.cs

示例15: RemotingCachedData

 internal RemotingCachedData(RuntimeParameterInfo ri)
 {
     this.RI = ri;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:4,代码来源:RemotingCachedData.cs


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