コード例 #1
0
 //
 // propertyHandle - the "tkPropertyDef" that identifies the property.
 // definingType   - the "tkTypeDef" that defined the field (this is where you get the metadata reader that created propertyHandle.)
 // contextType    - the type that supplies the type context (i.e. substitutions for generic parameters.) Though you
 //                  get your raw information from "definingType", you report "contextType" as your DeclaringType property.
 //
 //  For example:
 //
 //       typeof(Foo<>).GetTypeInfo().DeclaredMembers
 //
 //           The definingType and contextType are both Foo<>
 //
 //       typeof(Foo<int,String>).GetTypeInfo().DeclaredMembers
 //
 //          The definingType is "Foo<,>"
 //          The contextType is "Foo<int,String>"
 //
 //  We don't report any DeclaredMembers for arrays or generic parameters so those don't apply.
 //
 private RuntimePropertyInfo(PropertyHandle propertyHandle, RuntimeNamedTypeInfo definingTypeInfo, RuntimeTypeInfo contextTypeInfo)
 {
     _propertyHandle = propertyHandle;
     _definingTypeInfo = definingTypeInfo;
     _contextTypeInfo = contextTypeInfo;
     _reader = definingTypeInfo.Reader;
     _property = propertyHandle.GetProperty(_reader);
 }
コード例 #2
0
 //
 // propertyHandle - the "tkPropertyDef" that identifies the property.
 // definingType   - the "tkTypeDef" that defined the field (this is where you get the metadata reader that created propertyHandle.)
 // contextType    - the type that supplies the type context (i.e. substitutions for generic parameters.) Though you
 //                  get your raw information from "definingType", you report "contextType" as your DeclaringType property.
 //
 //  For example:
 //
 //       typeof(Foo<>).GetTypeInfo().DeclaredMembers
 //
 //           The definingType and contextType are both Foo<>
 //
 //       typeof(Foo<int,String>).GetTypeInfo().DeclaredMembers
 //
 //          The definingType is "Foo<,>"
 //          The contextType is "Foo<int,String>"
 //
 //  We don't report any DeclaredMembers for arrays or generic parameters so those don't apply.
 //
 private NativeFormatRuntimePropertyInfo(PropertyHandle propertyHandle, NativeFormatRuntimeNamedTypeInfo definingTypeInfo, RuntimeTypeInfo contextTypeInfo, RuntimeTypeInfo reflectedType) :
     base(contextTypeInfo, reflectedType)
 {
     _propertyHandle = propertyHandle;
     _definingTypeInfo = definingTypeInfo;
     _reader = definingTypeInfo.Reader;
     _property = propertyHandle.GetProperty(_reader);
 }
コード例 #3
0
        } // Read

        public static uint Read(this NativeReader reader, uint offset, out PropertyHandle[] values)
        {
            uint count;
            offset = reader.DecodeUnsigned(offset, out count);
            if (count == 0)
            {
                values = s_emptyPropertyHandleArray;
            }
            else
            {
                values = new PropertyHandle[count];
                for (uint i = 0; i < count; ++i)
                {
                    PropertyHandle tmp;
                    offset = reader.Read(offset, out tmp);
                    values[i] = tmp;
                }
            }
            return offset;
        } // Read
コード例 #4
0
        } // Read

        public static uint Read(this NativeReader reader, uint offset, out PropertyHandle handle)
        {
            uint value;
            offset = reader.DecodeUnsigned(offset, out value);
            handle = new PropertyHandle((int)value);
            handle._Validate();
            return offset;
        } // Read
コード例 #5
0
 public abstract IEnumerable<CustomAttributeData> GetPsuedoCustomAttributes(MetadataReader reader, PropertyHandle propertyHandle, TypeDefinitionHandle declaringTypeHandle);
コード例 #6
0
 public abstract bool GetDefaultValueIfAny(MetadataReader reader, PropertyHandle propertyHandle, Type declaredType, IEnumerable<CustomAttributeData> customAttributes, out Object defaultValue);
コード例 #7
0
        } // IsNull

        internal bool IsNull(PropertyHandle handle)
        {
            return (handle._value & 0x00FFFFFF) == 0;
        } // IsNull
コード例 #8
0
        } // ToHandle

        internal Handle ToHandle(PropertyHandle handle)
        {
            return new Handle(handle._value);
        } // ToHandle
コード例 #9
0
        } // GetPointerSignature

        public Property GetProperty(PropertyHandle handle)
        {
            var record = new Property() { _reader = this, _handle = handle };
            var offset = (uint)handle.Offset;
            offset = _streamReader.Read(offset, out record._flags);
            offset = _streamReader.Read(offset, out record._name);
            offset = _streamReader.Read(offset, out record._signature);
            offset = _streamReader.Read(offset, out record._methodSemantics);
            offset = _streamReader.Read(offset, out record._defaultValue);
            offset = _streamReader.Read(offset, out record._customAttributes);
            return record;
        } // GetProperty
コード例 #10
0
        } // Equals

        public bool Equals(PropertyHandle handle)
        {
            return _value == handle._value;
        } // Equals
コード例 #11
0
ファイル: MdBinaryReaderGen.cs プロジェクト: shahid-pk/corert
        } // Read

        public static uint Read(this NativeReader reader, uint offset, out PropertyHandle[] values)
        {
            uint count;
            offset = reader.DecodeUnsigned(offset, out count);
            #if !NETFX_45
            if (count == 0)
            {
                values = Array.Empty<PropertyHandle>();
            }
            else
            #endif
            {
                values = new PropertyHandle[count];
                for (uint i = 0; i < count; ++i)
                {
                    PropertyHandle tmp;
                    offset = reader.Read(offset, out tmp);
                    values[i] = tmp;
                }
            }
            return offset;
        } // Read