Serialize() 공개 메소드

public Serialize ( BinaryWriter writer, DataObject obj ) : void
writer System.IO.BinaryWriter
obj DataObject
리턴 void
예제 #1
0
        public override void Write(BinaryWriter writer, object obj)
        {
            var ol = (OnLoggedIn)obj;

            writer.Write(ol.DateTime.Ticks);
            writer.Write(ol.UserId);
            writer.Write(ol.UserName);
            writer.Write(ol.DefaultAlgoId);
            StreamerManager.Serialize(writer, ol.Fields);
        }
예제 #2
0
        public override void Write(BinaryWriter writer, object obj)
        {
            var array = (object[])obj;

            writer.Write(array.Length);
            for (int i = 0; i < array.Length; i++)
            {
                StreamerManager.Serialize(writer, array[i]);
            }
        }
예제 #3
0
        public override void Write(BinaryWriter writer, object obj)
        {
            var p = (Parameter)obj;

            writer.Write(p.Name);
            StreamerManager.Serialize(writer, p.Value);
            writer.Write(p.TypeName);
            writer.Write(p.Attributes.Length);
            var attributes = p.Attributes;

            for (int i = 0; i < attributes.Length; i++)
            {
                StreamerManager.Serialize(writer, attributes[i]);
            }
        }
예제 #4
0
        public override void Write(BinaryWriter writer, object obj)
        {
            var list = (ParameterList)obj;
            var ps   = list.Parameters().Select(p => StreamerManager.HasStreamer(p.Value.GetType()));

            writer.Write(list.Name);
            writer.Write(ps.Count());
            writer.Write(list.Methods.Count);
            foreach (var p in ps)
            {
                StreamerManager.Serialize(writer, p);
            }
            foreach (string m in list.Methods)
            {
                writer.Write(m);
            }
        }
예제 #5
0
        // Token: 0x060008B1 RID: 2225 RVA: 0x0002EC6C File Offset: 0x0002CE6C
        public override void Write(BinaryWriter writer, object obj)
        {
            var ou = (OnUnsubscribe)obj;

            writer.Write(ou.DateTime.Ticks);
            writer.Write(ou.Symbol);
            if (this.version >= 1)
            {
                writer.Write(ou.Subscription != null);
                if (ou.Subscription != null)
                {
                    writer.Write(ou.Subscription.SourceId);
                    writer.Write(ou.Subscription.ProviderId);
                    writer.Write(ou.Subscription.RouteId);
                    writer.Write(ou.Subscription.RequestId);
                    writer.Write(ou.Subscription.Symbol);
                    StreamerManager.Serialize(writer, ou.Subscription.Instrument);
                }
            }
        }
예제 #6
0
        public override void Write(BinaryWriter writer, object obj)
        {
            var data = (AccountData)obj;

            writer.Write(data.DateTime.Ticks);
            writer.Write((int)data.Type);
            writer.Write(data.Account);
            writer.Write(data.ProviderId);
            writer.Write(data.Route);
            var list = new List <AccountDataField>();

            foreach (AccountDataField field in data.Fields)
            {
                var type = field.Value.GetType();
                if (StreamerManager.HasStreamer(type))
                {
                    list.Add(field);
                }
                else if (type == typeof(object[]))
                {
                    var array = (object[])field.Value;
                    for (int i = 0; i < array.Length; i++)
                    {
                        StreamerManager.HasStreamer(array[i].GetType());
                    }
                    list.Add(field);
                }
            }
            writer.Write(list.Count);
            foreach (var field in list)
            {
                writer.Write(field.Name);
                writer.Write(field.Currency);
                StreamerManager.Serialize(writer, field.Value);
            }
        }