} // Read

        public static uint Read(this NativeReader reader, uint offset, out MemberReferenceHandle handle)
        {
            uint value;
            offset = reader.DecodeUnsigned(offset, out value);
            handle = new MemberReferenceHandle((int)value);
            handle._Validate();
            return offset;
        } // Read
        } // Read

        public static uint Read(this NativeReader reader, uint offset, out MemberReferenceHandle[] values)
        {
            uint count;
            offset = reader.DecodeUnsigned(offset, out count);
            if (count == 0)
            {
                values = s_emptyMemberReferenceHandleArray;
            }
            else
            {
                values = new MemberReferenceHandle[count];
                for (uint i = 0; i < count; ++i)
                {
                    MemberReferenceHandle tmp;
                    offset = reader.Read(offset, out tmp);
                    values[i] = tmp;
                }
            }
            return offset;
        } // Read
        } // IsNull

        internal bool IsNull(MemberReferenceHandle handle)
        {
            return (handle._value & 0x00FFFFFF) == 0;
        } // IsNull
        } // ToHandle

        internal Handle ToHandle(MemberReferenceHandle handle)
        {
            return new Handle(handle._value);
        } // ToHandle
        } // GetGenericParameter

        public MemberReference GetMemberReference(MemberReferenceHandle handle)
        {
            var record = new MemberReference() { _reader = this, _handle = handle };
            var offset = (uint)handle.Offset;
            offset = _streamReader.Read(offset, out record._parent);
            offset = _streamReader.Read(offset, out record._name);
            offset = _streamReader.Read(offset, out record._signature);
            offset = _streamReader.Read(offset, out record._customAttributes);
            return record;
        } // GetMemberReference
        } // Equals

        public bool Equals(MemberReferenceHandle handle)
        {
            return _value == handle._value;
        } // Equals
Beispiel #7
0
        } // Read

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