Esempio n. 1
0
        public static ComplexData Deserialize(BinaryReader r)
        {
            {
                bool isNotNull = r.ReadBoolean();
                if (!isNotNull)
                {
                    return(null);
                }
            }
            var ret = new ComplexData();

            ret.SomeByte   = r.ReadByte();
            ret.SomeShort  = r.ReadInt16();
            ret.SomeUShort = r.ReadUInt16();
            ret.SomeInt    = r.ReadInt32();
            ret.SomeUInt   = r.ReadUInt32();
            ret.SomeLong   = r.ReadInt64();
            ret.SomeULong  = r.ReadUInt64();
            ret.SomeString = StringSerializer.Deserialize(r);
            {
                if (!r.ReadBoolean())
                {
                    ret.SomeArrString = null;
                }
                else
                {
                    int lenght = r.ReadInt32();
                    var list   = new List <String>(lenght);
                    for (int i = 0; i < lenght; i++)
                    {
                        var x = StringSerializer.Deserialize(r);
                        list.Add(x);
                    }
                    ret.SomeArrString = list;
                }
            }
            {
                if (!r.ReadBoolean())
                {
                    ret.SomeArrRec = null;
                }
                else
                {
                    int lenght = r.ReadInt32();
                    var list   = new List <SubData>(lenght);
                    for (int i = 0; i < lenght; i++)
                    {
                        var x = SubDataSerializer.Deserialize(r);
                        list.Add(x);
                    }
                    ret.SomeArrRec = list;
                }
            }
            return(ret);
        }
		public async Task< ComplexData > Complex ( Int32 requestId, ComplexData data, String name, List<SubData> datas )
		{
			var request = MessageFactory.New< ISomeServiceComplexRequest >();
			request.requestId=requestId;
			request.data=data;
			request.name=name;
			request.datas=datas;
			Message reply = await ExecuteOperation(request);
			var ret = ((ISomeServiceComplexReply)reply).RetVal;
			MessageFactory.Free(reply);
			return ret;
		}
 public Task<ComplexData> Complex(int requestId, ComplexData data, string name, List<SubData> datas)
 {
     return Task.FromResult(
         new ComplexData
         {
             SomeInt = requestId,
             SomeULong = 0,
             SomeString = name,
             SomeArrString = new List<string> { "Test1", "Test2" },
             SomeArrRec = datas
         });
 }
Esempio n. 4
0
        public async Task <ComplexData> Complex(Int32 requestId, ComplexData data, String name, List <SubData> datas)
        {
            var request = MessageFactory.New <ISomeServiceComplexRequest>();

            request.requestId = requestId;
            request.data      = data;
            request.name      = name;
            request.datas     = datas;
            Message reply = await ExecuteOperation(request);

            var ret = ((ISomeServiceComplexReply)reply).RetVal;

            MessageFactory.Free(reply);
            return(ret);
        }
Esempio n. 5
0
 public static void Serialize(ComplexData x, BinaryWriter w)
 {
     if (x == null)
     {
         w.Write(false);
         return;
     }
     w.Write(true);
     w.Write(x.SomeByte);
     w.Write(x.SomeShort);
     w.Write(x.SomeUShort);
     w.Write(x.SomeInt);
     w.Write(x.SomeUInt);
     w.Write(x.SomeLong);
     w.Write(x.SomeULong);
     StringSerializer.Serialize(x.SomeString, w);
     if (x.SomeArrString != null)
     {
         w.Write(true);
         w.Write((int)x.SomeArrString.Count);
         foreach (var element in x.SomeArrString)
         {
             StringSerializer.Serialize(element, w);
         }
     }
     else
     {
         w.Write(false);
     }
     if (x.SomeArrRec != null)
     {
         w.Write(true);
         w.Write((int)x.SomeArrRec.Count);
         foreach (var element in x.SomeArrRec)
         {
             SubDataSerializer.Serialize(element, w);
         }
     }
     else
     {
         w.Write(false);
     }
 }
Esempio n. 6
0
 public override void Deserialize(BinaryReader r)
 {
     base.Deserialize(r);
     requestId = r.ReadInt32();
     data      = ComplexDataSerializer.Deserialize(r);
     name      = StringSerializer.Deserialize(r);
     {
         if (!r.ReadBoolean())
         {
             datas = null;
         }
         else
         {
             int lenght = r.ReadInt32();
             var list   = new List <SubData>(lenght);
             for (int i = 0; i < lenght; i++)
             {
                 var x = SubDataSerializer.Deserialize(r);
                 list.Add(x);
             }
             datas = list;
         }
     }
 }
Esempio n. 7
0
 public override void Deserialize(BinaryReader r)
 {
     base.Deserialize(r);
     RetVal = ComplexDataSerializer.Deserialize(r);
 }
		public static ComplexData Deserialize(BinaryReader r)
		{
			{
				bool isNotNull = r.ReadBoolean();
				if(!isNotNull)
					return null;
			}
			var ret = new ComplexData();
			ret.SomeByte = r.ReadByte();
			ret.SomeShort = r.ReadInt16();
			ret.SomeUShort = r.ReadUInt16();
			ret.SomeInt = r.ReadInt32();
			ret.SomeUInt = r.ReadUInt32();
			ret.SomeLong = r.ReadInt64();
			ret.SomeULong = r.ReadUInt64();
			ret.SomeString = StringSerializer.Deserialize(r);
			{
				if(!r.ReadBoolean())
					ret.SomeArrString = null;
				else
				{
					int lenght = r.ReadInt32();
					var list = new List<String>(lenght);
					for(int i = 0; i < lenght; i++)
					{
						var x = StringSerializer.Deserialize(r);
						list.Add(x);
					}
					ret.SomeArrString = list;
				}
			}
			{
				if(!r.ReadBoolean())
					ret.SomeArrRec = null;
				else
				{
					int lenght = r.ReadInt32();
					var list = new List<SubData>(lenght);
					for(int i = 0; i < lenght; i++)
					{
						var x = SubDataSerializer.Deserialize(r);
						list.Add(x);
					}
					ret.SomeArrRec = list;
				}
			}
			return ret;
		}
		public static void Serialize(ComplexData x, BinaryWriter w)
		{
			if(x == null)
			{
				w.Write(false);
				return;
			}
			w.Write(true);
			w.Write(x.SomeByte);
			w.Write(x.SomeShort);
			w.Write(x.SomeUShort);
			w.Write(x.SomeInt);
			w.Write(x.SomeUInt);
			w.Write(x.SomeLong);
			w.Write(x.SomeULong);
			StringSerializer.Serialize(x.SomeString, w);
			if(x.SomeArrString != null)
			{
				w.Write(true);
				w.Write((int)x.SomeArrString.Count);
				foreach(var element in x.SomeArrString)
					StringSerializer.Serialize(element, w);
			}
			else
				w.Write(false);
			if(x.SomeArrRec != null)
			{
				w.Write(true);
				w.Write((int)x.SomeArrRec.Count);
				foreach(var element in x.SomeArrRec)
					SubDataSerializer.Serialize(element, w);
			}
			else
				w.Write(false);
		}
        public override void Deserialize(BinaryReader r)
        {
            base.Deserialize(r);
			RetVal = ComplexDataSerializer.Deserialize(r);
        }
        public override void Deserialize(BinaryReader r)
        {
            base.Deserialize(r);
			requestId = r.ReadInt32();
			data = ComplexDataSerializer.Deserialize(r);
			name = StringSerializer.Deserialize(r);
			{
				if(!r.ReadBoolean())
					datas = null;
				else
				{
					int lenght = r.ReadInt32();
					var list = new List<SubData>(lenght);
					for(int i = 0; i < lenght; i++)
					{
						var x = SubDataSerializer.Deserialize(r);
						list.Add(x);
					}
					datas = list;
				}
			}
        }