• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Reflection.RuntimeFieldInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: GetCustomAttribute

        internal static Attribute GetCustomAttribute(RuntimeFieldInfo field) 
        { 
            if ((field.Attributes & FieldAttributes.NotSerialized) == 0)
                return null;

            return new NonSerializedAttribute();
        }
开发者ID:REALTOBIZ,项目名称:mono,代码行数:7,代码来源:nonserializedattribute.cs


示例2: SerializationFieldInfo

 internal SerializationFieldInfo(RuntimeFieldInfo field, String namePrefix) {
     BCLDebug.Assert(field!=null,      "[SerializationFieldInfo.ctor]field!=null");
     BCLDebug.Assert(namePrefix!=null, "[SerializationFieldInfo.ctor]namePrefix!=null");
     
     m_field = field;
     m_serializationName = String.Concat(namePrefix, FakeNameSeparatorString, m_field.Name);
 }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:7,代码来源:serializationfieldinfo.cs


示例3: GetCustomAttribute

		internal static Attribute GetCustomAttribute(RuntimeFieldInfo field)
		{
			if ((field.Attributes & FieldAttributes.NotSerialized) == FieldAttributes.PrivateScope)
			{
				return null;
			}
			return new NonSerializedAttribute();
		}
开发者ID:ChristianWulf,项目名称:CSharpKDMDiscoverer,代码行数:8,代码来源:NonSerializedAttribute.cs


示例4: AllowCriticalCustomAttributes

 private static bool AllowCriticalCustomAttributes(RuntimeFieldInfo field)
 {
     if (field.IsSecurityTransparent)
     {
         return SpecialAllowCriticalAttributes((RuntimeType) field.DeclaringType);
     }
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:CustomAttribute.cs


示例5: GetCustomAttribute

 internal static Attribute GetCustomAttribute(RuntimeFieldInfo field)
 {
     int num;
     if ((field.DeclaringType != null) && field.GetRuntimeModule().MetadataImport.GetFieldOffset(field.DeclaringType.MetadataToken, field.MetadataToken, out num))
     {
         return new FieldOffsetAttribute(num);
     }
     return null;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:FieldOffsetAttribute.cs


示例6: GetCustomAttributes

 internal static Attribute[] GetCustomAttributes(RuntimeFieldInfo field, 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(MarshalAsAttribute))))
     {
         customAttribute = MarshalAsAttribute.GetCustomAttribute(field);
         if (customAttribute != null)
         {
             attributeArray[count++] = customAttribute;
         }
     }
     if (flag || (caType == ((RuntimeType) typeof(FieldOffsetAttribute))))
     {
         customAttribute = FieldOffsetAttribute.GetCustomAttribute(field);
         if (customAttribute != null)
         {
             attributeArray[count++] = customAttribute;
         }
     }
     if (flag || (caType == ((RuntimeType) typeof(NonSerializedAttribute))))
     {
         customAttribute = NonSerializedAttribute.GetCustomAttribute(field);
         if (customAttribute != null)
         {
             attributeArray[count++] = customAttribute;
         }
     }
     return attributeArray;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:36,代码来源:PseudoCustomAttribute.cs


示例7: GetCustomAttributes

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

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


示例8: IsDefined

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

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

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


示例9: GetTokenFor

        private int GetTokenFor(RuntimeFieldInfo runtimeField, RuntimeType rtType)
        {
#if FEATURE_APPX
            if (ProfileAPICheck)
            {
                RtFieldInfo rtField = runtimeField as RtFieldInfo;
                if (rtField != null && (rtField.InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0)
                    throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", rtField.FullName));

                if ((rtType.InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NON_W8P_FX_API) != 0)
                    throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_APIInvalidForCurrentContext", rtType.FullName));
            }
#endif

            return m_scope.GetTokenFor(runtimeField.FieldHandle, rtType.TypeHandle);
        }
开发者ID:Clockwork-Muse,项目名称:coreclr,代码行数:16,代码来源:DynamicILGenerator.cs


示例10: RemotingFieldCachedData

		internal RemotingFieldCachedData(RuntimeFieldInfo ri)
		{
		}
开发者ID:Profit0004,项目名称:mono,代码行数:3,代码来源:RemotingFieldCachedData.cs


示例11: IsDefined

        internal static bool IsDefined(RuntimeFieldInfo field, RuntimeType caType)
        {
            ASSERT.PRECONDITION(field != null);

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

            return IsCustomAttributeDefined(field.Module, field.MetadataToken, caType);
        }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:9,代码来源:customattribute.cs


示例12: GetCustomAttributesInternal

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

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

            int pcaCount = 0;
            Attribute[] a = PseudoCustomAttribute.GetCustomAttributes((RuntimeFieldInfo)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,代码行数:22,代码来源:CustomAttribute.cs


示例13: GetCustomAttribute

        [System.Security.SecurityCritical]  // auto-generated
        internal static Attribute GetCustomAttribute(RuntimeFieldInfo field)
        {
            int fieldOffset;

            if (field.DeclaringType != null &&
#if MONO
                (fieldOffset = field.GetFieldOffset ()) >= 0)
#else
                field.GetRuntimeModule().MetadataImport.GetFieldOffset(field.DeclaringType.MetadataToken, field.MetadataToken, out fieldOffset))
#endif
                return new FieldOffsetAttribute(fieldOffset);

            return null;
        }
开发者ID:razzfazz,项目名称:mono,代码行数:15,代码来源:attributes.cs


示例14: RemotingCachedData

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


示例15: IsDefined

		internal static bool IsDefined(RuntimeFieldInfo field)
		{
			return (field.Attributes & FieldAttributes.NotSerialized) != FieldAttributes.PrivateScope;
		}
开发者ID:ChristianWulf,项目名称:CSharpKDMDiscoverer,代码行数:4,代码来源:NonSerializedAttribute.cs


示例16: GetCustomAttributes

        internal static Attribute[] GetCustomAttributes(RuntimeFieldInfo field, Type caType, out int count) 
        {
            ASSERT.PRECONDITION(field != null);
            ASSERT.PRECONDITION(caType != null);

            count = 0;

            bool all = caType == typeof(object) || caType == typeof(Attribute);
            if (!all && s_pca[caType] == null)
                return null;

            Attribute[] pcas = new Attribute[s_pcasCount];
            Attribute pca = null;

            if (all || caType == typeof(MarshalAsAttribute))
            {               
                pca = MarshalAsAttribute.GetCustomAttribute(field);
                if (pca != null) pcas[count++] = pca;
            }
            if (all || caType == typeof(FieldOffsetAttribute))
            {               
                pca = FieldOffsetAttribute.GetCustomAttribute(field);
                if (pca != null) pcas[count++] = pca;
            }
            if (all || caType == typeof(NonSerializedAttribute))
            {               
                pca = NonSerializedAttribute.GetCustomAttribute(field);
                if (pca != null) pcas[count++] = pca;
            }
            return pcas;
        }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:31,代码来源:customattribute.cs


示例17: GetCustomAttributesInternal

 internal static IList<CustomAttributeData> GetCustomAttributesInternal(RuntimeFieldInfo 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


示例18: SerializationFieldInfo

 internal SerializationFieldInfo(RuntimeFieldInfo field, string namePrefix)
 {
     this.m_field = field;
     this.m_serializationName = namePrefix + FakeNameSeparatorString + this.m_field.Name;
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:5,代码来源:SerializationFieldInfo.cs


示例19: SerializationFieldInfo

 internal SerializationFieldInfo(RuntimeFieldInfo field, string namePrefix)
 {
     this.m_field = field;
     this.m_serializationName = namePrefix + "+" + this.m_field.Name;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:5,代码来源:SerializationFieldInfo.cs


示例20: IsDefined

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Reflection.RuntimeMethodInfo类代码示例发布时间:2022-05-26
下一篇:
C# Reflection.PropertyInfo类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap