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

            return new NonSerializedAttribute();
        }
 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);
 }
Beispiel #3
0
 private static bool AllowCriticalCustomAttributes(RuntimeFieldInfo field)
 {
     if (field.IsSecurityTransparent)
     {
         return(CustomAttribute.SpecialAllowCriticalAttributes((RuntimeType)field.DeclaringType));
     }
     return(true);
 }
Beispiel #4
0
 internal static bool IsDefined(RuntimeFieldInfo field, RuntimeType caType)
 {
     if (PseudoCustomAttribute.IsDefined(field, caType))
     {
         return(true);
     }
     return(CustomAttribute.IsCustomAttributeDefined(field.GetRuntimeModule(), field.MetadataToken, caType));
 }
 private static bool AllowCriticalCustomAttributes(RuntimeFieldInfo field)
 {
     if (field.IsSecurityTransparent)
     {
         return SpecialAllowCriticalAttributes((RuntimeType) field.DeclaringType);
     }
     return true;
 }
		internal static Attribute GetCustomAttribute(RuntimeFieldInfo field)
		{
			if ((field.Attributes & FieldAttributes.NotSerialized) == FieldAttributes.PrivateScope)
			{
				return null;
			}
			return new NonSerializedAttribute();
		}
 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;
 }
        internal static bool IsDefined(RuntimeFieldInfo field, Type caType)
        {
            bool flag = (caType == typeof(object)) || (caType == typeof(Attribute));

            if (!flag && (s_pca[caType] == null))
            {
                return(false);
            }
            return(((flag || (caType == typeof(MarshalAsAttribute))) && MarshalAsAttribute.IsDefined(field)) || (((flag || (caType == typeof(FieldOffsetAttribute))) && FieldOffsetAttribute.IsDefined(field)) || ((flag || (caType == typeof(NonSerializedAttribute))) && NonSerializedAttribute.IsDefined(field))));
        }
Beispiel #9
0
        internal RuntimeFieldInfo Clone(string newName)
        {
            RuntimeFieldInfo field = new RuntimeFieldInfo();

            field.name    = newName;
            field.type    = type;
            field.attrs   = attrs;
            field.klass   = klass;
            field.fhandle = fhandle;
            return(field);
        }
        internal static object[] GetCustomAttributes(RuntimeFieldInfo field, RuntimeType caType)
        {
            int count = 0;

            Attribute[] sourceArray      = PseudoCustomAttribute.GetCustomAttributes(field, caType, out count);
            object[]    destinationArray = GetCustomAttributes(field.GetRuntimeModule(), field.MetadataToken, count, caType, !AllowCriticalCustomAttributes(field));
            if (count > 0)
            {
                Array.Copy(sourceArray, 0, destinationArray, destinationArray.Length - count, count);
            }
            return(destinationArray);
        }
Beispiel #11
0
        internal static object[] GetCustomAttributes(RuntimeFieldInfo field, RuntimeType caType)
        {
            int count = 0;

            Attribute[] customAttributes1 = PseudoCustomAttribute.GetCustomAttributes(field, caType, out count);
            object[]    customAttributes2 = CustomAttribute.GetCustomAttributes(field.GetRuntimeModule(), field.MetadataToken, count, caType, !CustomAttribute.AllowCriticalCustomAttributes(field));
            if (count > 0)
            {
                Array.Copy((Array)customAttributes1, 0, (Array)customAttributes2, customAttributes2.Length - count, count);
            }
            return(customAttributes2);
        }
        internal static object[] GetCustomAttributes(RuntimeFieldInfo field, RuntimeType caType)
        {
            int num = 0;

            Attribute[] customAttributes  = PseudoCustomAttribute.GetCustomAttributes(field, caType, out num);
            object[]    customAttributes2 = CustomAttribute.GetCustomAttributes(field.GetRuntimeModule(), field.MetadataToken, num, caType, !CustomAttribute.AllowCriticalCustomAttributes(field));
            if (num > 0)
            {
                Array.Copy(customAttributes, 0, customAttributes2, customAttributes2.Length - num, num);
            }
            return(customAttributes2);
        }
Beispiel #13
0
        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 && PseudoCustomAttribute.s_pca.GetValueOrDefault(caType) == null)
            {
                return(null);
            }
            Attribute[] array = new Attribute[PseudoCustomAttribute.s_pcasCount];
            if (flag || caType == (RuntimeType)typeof(MarshalAsAttribute))
            {
                Attribute customAttribute = MarshalAsAttribute.GetCustomAttribute(field);
                if (customAttribute != null)
                {
                    Attribute[] array2 = array;
                    int         num    = count;
                    count       = num + 1;
                    array2[num] = customAttribute;
                }
            }
            if (flag || caType == (RuntimeType)typeof(FieldOffsetAttribute))
            {
                Attribute customAttribute = FieldOffsetAttribute.GetCustomAttribute(field);
                if (customAttribute != null)
                {
                    Attribute[] array3 = array;
                    int         num    = count;
                    count       = num + 1;
                    array3[num] = customAttribute;
                }
            }
            if (flag || caType == (RuntimeType)typeof(NonSerializedAttribute))
            {
                Attribute customAttribute = NonSerializedAttribute.GetCustomAttribute(field);
                if (customAttribute != null)
                {
                    Attribute[] array4 = array;
                    int         num    = count;
                    count       = num + 1;
                    array4[num] = customAttribute;
                }
            }
            return(array);
        }
Beispiel #14
0
        internal static IList <CustomAttributeData> GetCustomAttributesInternal(RuntimeFieldInfo target)
        {
            IList <CustomAttributeData> customAttributes1 = CustomAttributeData.GetCustomAttributes(target.GetRuntimeModule(), target.MetadataToken);
            int count = 0;

            Attribute[] customAttributes2 = PseudoCustomAttribute.GetCustomAttributes(target, typeof(object) as RuntimeType, out count);
            if (count == 0)
            {
                return(customAttributes1);
            }
            CustomAttributeData[] array = new CustomAttributeData[customAttributes1.Count + count];
            customAttributes1.CopyTo(array, count);
            for (int index = 0; index < count; ++index)
            {
                array[index] = new CustomAttributeData(customAttributes2[index]);
            }
            return((IList <CustomAttributeData>)Array.AsReadOnly <CustomAttributeData>(array));
        }
Beispiel #15
0
        internal static IList <CustomAttributeData> GetCustomAttributesInternal(RuntimeFieldInfo target)
        {
            IList <CustomAttributeData> customAttributes = CustomAttributeData.GetCustomAttributes(target.GetRuntimeModule(), target.MetadataToken);
            int num = 0;

            Attribute[] customAttributes2 = PseudoCustomAttribute.GetCustomAttributes(target, typeof(object) as RuntimeType, out num);
            if (num == 0)
            {
                return(customAttributes);
            }
            CustomAttributeData[] array = new CustomAttributeData[customAttributes.Count + num];
            customAttributes.CopyTo(array, num);
            for (int i = 0; i < num; i++)
            {
                array[i] = new CustomAttributeData(customAttributes2[i]);
            }
            return(Array.AsReadOnly <CustomAttributeData>(array));
        }
Beispiel #16
0
        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));
        }
        internal static Attribute[] GetCustomAttributes(RuntimeFieldInfo field, Type caType, out int count)
        {
            count = 0;
            bool flag = (caType == typeof(object)) || (caType == typeof(Attribute));

            if (!flag && (s_pca[caType] == null))
            {
                return(null);
            }
            Attribute[] attributeArray  = new Attribute[s_pcasCount];
            Attribute   customAttribute = null;

            if (flag || (caType == typeof(MarshalAsAttribute)))
            {
                customAttribute = MarshalAsAttribute.GetCustomAttribute(field);
                if (customAttribute != null)
                {
                    attributeArray[count++] = customAttribute;
                }
            }
            if (flag || (caType == typeof(FieldOffsetAttribute)))
            {
                customAttribute = FieldOffsetAttribute.GetCustomAttribute(field);
                if (customAttribute != null)
                {
                    attributeArray[count++] = customAttribute;
                }
            }
            if (flag || (caType == typeof(NonSerializedAttribute)))
            {
                customAttribute = NonSerializedAttribute.GetCustomAttribute(field);
                if (customAttribute != null)
                {
                    attributeArray[count++] = customAttribute;
                }
            }
            return(attributeArray);
        }
 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;
 }
Beispiel #19
0
        [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;
        }
        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);
        }
Beispiel #21
0
        [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);
        }
		internal RemotingFieldCachedData(RuntimeFieldInfo ri)
		{
		}
Beispiel #23
0
        internal static bool IsDefined(RuntimeFieldInfo field, RuntimeType caType)
        {
            bool flag = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);

            return((flag || !(PseudoCustomAttribute.s_pca.GetValueOrDefault(caType) == null)) && (((flag || caType == (RuntimeType)typeof(MarshalAsAttribute)) && MarshalAsAttribute.IsDefined(field)) || ((flag || caType == (RuntimeType)typeof(FieldOffsetAttribute)) && FieldOffsetAttribute.IsDefined(field)) || ((flag || caType == (RuntimeType)typeof(NonSerializedAttribute)) && NonSerializedAttribute.IsDefined(field))));
        }
Beispiel #24
0
 internal static bool IsDefined(RuntimeFieldInfo field, RuntimeType caType)
 {
     return (PseudoCustomAttribute.IsDefined(field, caType) || IsCustomAttributeDefined(field.Module, field.MetadataToken, caType));
 }
 internal SerializationFieldInfo(RuntimeFieldInfo field, string namePrefix)
 {
     this.m_field = field;
     this.m_serializationName = namePrefix + FakeNameSeparatorString + this.m_field.Name;
 }
Beispiel #26
0
		RuntimeFieldInfo[] GetFields_internal (string name, BindingFlags bindingAttr, RuntimeType reflectedType)
		{
			var refh = new RuntimeTypeHandle (reflectedType);
			using (var h = new Mono.SafeGPtrArrayHandle (GetFields_native (name, bindingAttr))) {
				int n = h.Length;
				var a = new RuntimeFieldInfo[n];
				for (int i = 0; i < n; i++) {
					var fh = new RuntimeFieldHandle (h[i]);
					a[i] = (RuntimeFieldInfo) FieldInfo.GetFieldFromHandle (fh, refh);
				}
				return a;
			}
		}
        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);
        }
Beispiel #28
0
        [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;
        }
 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);
 }
Beispiel #30
0
        [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);
        }
Beispiel #31
0
        [System.Security.SecurityCritical]  // auto-generated
        internal static Attribute[] GetCustomAttributes(RuntimeFieldInfo field, RuntimeType caType, out int count)
        {
            Contract.Requires(field != null);
            Contract.Requires(caType != null);

            count = 0;

            bool all = caType == (RuntimeType)typeof(object) || caType == (RuntimeType)typeof(Attribute);
            if (!all && s_pca.GetValueOrDefault(caType) == null)
                return null;

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

            if (all || caType == (RuntimeType)typeof(MarshalAsAttribute))
            {
                pca = MarshalAsAttribute.GetCustomAttribute(field);
                if (pca != null) pcas[count++] = pca;
            }
            if (all || caType == (RuntimeType)typeof(FieldOffsetAttribute))
            {
                pca = FieldOffsetAttribute.GetCustomAttribute(field);
                if (pca != null) pcas[count++] = pca;
            }
#if FEATURE_SERIALIZATION
            if (all || caType == (RuntimeType)typeof(NonSerializedAttribute))
            {
                pca = NonSerializedAttribute.GetCustomAttribute(field);
                if (pca != null) pcas[count++] = pca;
            }
#endif
            return pcas;
        }
 internal static Object[] GetCustomAttributes(RuntimeFieldInfo field, RuntimeType caType)
 {
     int pcaCount = 0;
     Attribute[] pca = PseudoCustomAttribute.GetCustomAttributes(field, caType, out pcaCount);
     object[] attributes = GetCustomAttributes(field.Module, field.MetadataToken, pcaCount, caType);
     if (pcaCount > 0) Array.Copy(pca, 0, attributes, attributes.Length - pcaCount, pcaCount);
     return attributes;
 }
        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;
        }
        internal static bool IsDefined(RuntimeFieldInfo field, Type caType) 
        {
            bool all = caType == typeof(object) || caType == typeof(Attribute);
            if (!all && s_pca[caType] == null)
                return false;

            if (all || caType == typeof(MarshalAsAttribute)) 
            { 
                if (MarshalAsAttribute.IsDefined(field)) return true;
            }
            if (all || caType == typeof(FieldOffsetAttribute)) 
            { 
                if (FieldOffsetAttribute.IsDefined(field)) return true;
            }
            if (all || caType == typeof(NonSerializedAttribute)) 
            { 
                if (NonSerializedAttribute.IsDefined(field)) return true;
            }

            return false;
        }
Beispiel #35
0
        [System.Security.SecurityCritical]  // auto-generated
        internal static bool IsDefined(RuntimeFieldInfo field, 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(MarshalAsAttribute))
            {
                if (MarshalAsAttribute.IsDefined(field)) return true;
            }
            if (all || caType == (RuntimeType)typeof(FieldOffsetAttribute))
            {
                if (FieldOffsetAttribute.IsDefined(field)) return true;
            }
#if FEATURE_SERIALIZATION
            if (all || caType == (RuntimeType)typeof(NonSerializedAttribute)) 
            { 
                if (NonSerializedAttribute.IsDefined(field)) return true;
            }
#endif

            return false;
        }
Beispiel #36
0
 internal static extern int get_metadata_token(RuntimeFieldInfo monoField);
Beispiel #37
0
 [System.Security.SecurityCritical]  // auto-generated
 internal static Attribute GetCustomAttribute(RuntimeFieldInfo field)
 {
     return GetCustomAttribute(field.MetadataToken, field.GetRuntimeModule()); ;
 }
Beispiel #38
0
 internal static bool IsDefined(RuntimeFieldInfo field, RuntimeType caType)
 {
     return(PseudoCustomAttribute.IsDefined(field, caType) || IsCustomAttributeDefined(field.Module, field.MetadataToken, caType));
 }
Beispiel #39
0
 [System.Security.SecurityCritical]  // auto-generated
 internal static bool IsDefined(RuntimeFieldInfo field)
 {
     return GetCustomAttribute(field) != null;
 }
        [System.Security.SecurityCritical]  // auto-generated
        internal static bool IsDefined(RuntimeFieldInfo field, RuntimeType caType)
        {
            Contract.Requires(field != 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(field, caType))
                return true;

            return IsCustomAttributeDefined(field.GetRuntimeModule(), field.MetadataToken, caType);
        }
Beispiel #41
0
 internal extern int InternalGetMemberRefOfFieldInfo(int tr, RuntimeFieldInfo con);
Beispiel #42
0
 internal static object[] GetCustomAttributes(RuntimeFieldInfo field, RuntimeType caType)
 {
     int count = 0;
     Attribute[] sourceArray = PseudoCustomAttribute.GetCustomAttributes(field, caType, out count);
     object[] destinationArray = GetCustomAttributes(field.Module, field.MetadataToken, count, caType);
     if (count > 0)
     {
         Array.Copy(sourceArray, 0, destinationArray, destinationArray.Length - count, count);
     }
     return destinationArray;
 }
		internal static bool IsDefined(RuntimeFieldInfo field)
		{
			return (field.Attributes & FieldAttributes.NotSerialized) != FieldAttributes.PrivateScope;
		}
 internal RemotingCachedData(RuntimeFieldInfo ri)
 {
     this.RI = ri;
 }
Beispiel #45
0
 /// <include file='doc\FieldInfo.uex' path='docs/doc[@for="FieldInfo.GetFieldFromHandle"]/*' />
 public static FieldInfo GetFieldFromHandle(RuntimeFieldHandle handle)
 {
     return(RuntimeFieldInfo.GetFieldFromHandleImp(handle));
 }
 internal SerializationFieldInfo(RuntimeFieldInfo field, string namePrefix)
 {
     this.m_field = field;
     this.m_serializationName = namePrefix + "+" + this.m_field.Name;
 }
Beispiel #47
0
        [System.Security.SecurityCritical]  // auto-generated
        private int GetMemberRefOfFieldInfo(int tkType, RuntimeTypeHandle declaringType, RuntimeFieldInfo runtimeField)
        {
            Contract.Assert(runtimeField != null);

#if FEATURE_APPX
            if (ContainingAssemblyBuilder.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));
            }
#endif

            return GetMemberRefOfFieldInfo(GetNativeHandle(), tkType, declaringType, runtimeField.MetadataToken);
        }
 internal static IList <CustomAttributeData> GetCustomAttributesInternal(RuntimeFieldInfo target)
 {
     return(CustomAttribute.GetCustomAttributesData(target));
 }