예제 #1
0
        public override void WriteObject(object obj, Com.Bj58.Spat.Gaea.Serializer.Component.GaeaStream outStream)
        {
            outStream.WriteUInt32(obj.GetType().GetTypeId());
            string value = obj.ToString();

            SerializerFactory.GetSerializer(typeof(string)).WriteObject(value, outStream);
        }
예제 #2
0
        public override object ReadObject(Com.Bj58.Spat.Gaea.Serializer.Component.GaeaStream inStream, Type defType)
        {
            uint   typeId = inStream.ReadUInt32();
            Type   type   = typeId.ToType();
            String value  = Convert.ToString(SerializerFactory.GetSerializer(typeof(string)).ReadObject(inStream, typeof(string)));

            return(Enum.Parse(type, value));
        }
예제 #3
0
        public override object ReadObject(Com.Bj58.Spat.Gaea.Serializer.Component.GaeaStream inStream, Type defType)
        {
            object value = SerializerFactory.GetSerializer(typeof(string)).ReadObject(inStream, typeof(string));

            if (value != null)
            {
                return(decimal.Parse(value.ToString()));
            }
            return(default(decimal));
        }
예제 #4
0
 public override void WriteObject(object obj, Com.Bj58.Spat.Gaea.Serializer.Component.GaeaStream outStream)
 {
     SerializerFactory.GetSerializer(typeof(string)).WriteObject(obj.ToString(), outStream);
 }