} // Read

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

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

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

        internal Handle ToHandle(ConstantBoxedEnumValueHandle handle)
        {
            return new Handle(handle._value);
        } // ToHandle
        } // GetConstantBooleanValue

        public ConstantBoxedEnumValue GetConstantBoxedEnumValue(ConstantBoxedEnumValueHandle handle)
        {
            var record = new ConstantBoxedEnumValue() { _reader = this, _handle = handle };
            var offset = (uint)handle.Offset;
            offset = _streamReader.Read(offset, out record._value);
            offset = _streamReader.Read(offset, out record._type);
            return record;
        } // GetConstantBoxedEnumValue
        } // Equals

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

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