Deserialize() public method

public Deserialize ( BinaryReader reader ) : object
reader System.IO.BinaryReader
return object
Example #1
0
        public override object Read(BinaryReader reader, byte version)
        {
            int length = reader.ReadInt32();
            var array  = new object[length];

            for (int i = 0; i < length; i++)
            {
                array[i] = StreamerManager.Deserialize(reader);
            }
            return(array);
        }
Example #2
0
        public override object Read(BinaryReader reader, byte version)
        {
            var dateTime = new DateTime(reader.ReadInt64());

            return(new OnLoggedIn(dateTime)
            {
                UserId = reader.ReadInt32(),
                UserName = reader.ReadString(),
                DefaultAlgoId = reader.ReadInt32(),
                Fields = (ObjectTable)StreamerManager.Deserialize(reader)
            });
        }
Example #3
0
        public override object Read(BinaryReader reader, byte version)
        {
            var list = new ParameterList();

            list.Name = reader.ReadString();
            int pCount = reader.ReadInt32();
            int mCount = reader.ReadInt32();

            for (int i = 0; i < pCount; i++)
            {
                list.Add(StreamerManager.Deserialize(reader) as Parameter);
            }
            for (int j = 0; j < mCount; j++)
            {
                list.Methods.Add(reader.ReadString());
            }
            return(list);
        }
Example #4
0
        public override object Read(BinaryReader reader, byte version)
        {
            var name       = reader.ReadString();
            var value      = StreamerManager.Deserialize(reader);
            var typeName   = reader.ReadString();
            int count      = reader.ReadInt32();
            var attributes = new List <Attribute>();

            for (int i = 0; i < count; i++)
            {
                var attribute = StreamerManager.Deserialize(reader) as Attribute;
                if (attribute != null)
                {
                    attributes.Add(attribute);
                }
            }
            return(new Parameter(name, value, typeName, attributes.ToArray()));
        }
Example #5
0
        public override object Read(BinaryReader reader, byte version)
        {
            var datetime    = new DateTime(reader.ReadInt64());
            var type        = (AccountDataType)reader.ReadInt32();
            var account     = reader.ReadString();
            var providerId  = reader.ReadByte();
            var route       = reader.ReadByte();
            var accountData = new AccountData(datetime, type, account, providerId, route);
            int count       = reader.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                var    name     = reader.ReadString();
                var    currency = reader.ReadString();
                object value    = StreamerManager.Deserialize(reader);
                accountData.Fields.Add(name, currency, value);
            }
            return(accountData);
        }
Example #6
0
        public override object Read(BinaryReader reader, byte version)
        {
            var ou = new OnUnsubscribe();

            ou.DateTime = new DateTime(reader.ReadInt64());
            ou.Symbol   = reader.ReadString();
            if (version >= 1 && reader.ReadBoolean())
            {
                ou.Subscription = new Subscription
                {
                    SourceId   = reader.ReadInt32(),
                    ProviderId = reader.ReadInt32(),
                    RouteId    = reader.ReadInt32(),
                    RequestId  = reader.ReadInt32(),
                    Symbol     = reader.ReadString(),
                    Instrument = (Instrument)StreamerManager.Deserialize(reader)
                };
            }
            return(ou);
        }