Example #1
0
        public IDynamicProperty DefineDynamicProperty(String propertyName, Type propertyType, PropertyFlags flags)
        {
            DynamicProperty dynamicProperty = ( DynamicProperty )this.AddProperty(propertyName, propertyType, flags, this._fieldBuilder, this._typeBuilder);

            if (flags.HasFlag(PropertyFlags.ReadAndWrite))
            {
                dynamicProperty.DefineGetMethod();
                dynamicProperty.DefineSetMethod();
            }
            else if (flags.HasFlag(PropertyFlags.ReadOnly))
            {
                dynamicProperty.DefineGetMethod();
            }
            else if (flags.HasFlag(PropertyFlags.WriteOnly))
            {
                dynamicProperty.DefineSetMethod();
            }

            return(dynamicProperty);
        }
Example #2
0
        public override bool Deserialize()
        {
            var result = base.Deserialize();

            var ArrayInfo = Data.ReadInt32();
            ArraySize = (UInt16)(ArrayInfo & 0x0000FFFFU);
            ArrayElementSize = (UInt16)(ArrayInfo >> 16);

            PropertyFlags = (PropertyFlags)Data.ReadUInt64();
            if (PropertyFlags.HasFlag(PropertyFlags.Net))
                ReplicateOffset = Data.ReadUInt16();

            _CategoryNameRef = Data.ReadNameRef();
            Category = PCC.GetName(_CategoryNameRef);

            ReplicateOffset = Data.ReadUInt16(); // TODO: verify, see code
            ReplicateIndex = Data.ReadUInt16();

            return result;
        }
Example #3
0
        public override bool Deserialize()
        {
            var result = base.Deserialize();

            var ArrayInfo = Data.ReadInt32();

            ArraySize        = (UInt16)(ArrayInfo & 0x0000FFFFU);
            ArrayElementSize = (UInt16)(ArrayInfo >> 16);

            PropertyFlags = (PropertyFlags)Data.ReadUInt64();
            if (PropertyFlags.HasFlag(PropertyFlags.Net))
            {
                ReplicateOffset = Data.ReadUInt16();
            }

            _CategoryNameRef = Data.ReadNameRef();
            Category         = PCC.GetName(_CategoryNameRef);

            ReplicateOffset = Data.ReadUInt16(); // TODO: verify, see code
            ReplicateIndex  = Data.ReadUInt16();

            return(result);
        }