Example #1
0
        public ResponseMessage(BinaryReader br)

        {
            int len = br.ReadInt32() - 4;

            byte[] arrayOfByte = new byte[len];
            br.Read(arrayOfByte, 0, arrayOfByte.Length);
            Storage localStorage = new Storage(arrayOfByte);

            while (localStorage.validPos())
            {
                StatusResponse    localStatusResponse = new StatusResponse(localStorage);
                ResponseContainer localResponseContainer;
                if (localStatusResponse.Result() != 0)
                {
                    localResponseContainer = new ResponseContainer(localStatusResponse, null);
                }
                else if (localStatusResponse.Id() == 2)
                {
                    int            j = localStorage.readInt();
                    List <Command> localArrayList = new List <Command>(j);
                    for (int k = 0; k < j; k++)
                    {
                        localArrayList.Add(new Command(localStorage));
                    }
                    localResponseContainer = new ResponseContainer(localStatusResponse, null, localArrayList);
                }
                else if (isStatusOnlyResponse(localStatusResponse.Id()))
                {
                    localResponseContainer = new ResponseContainer(localStatusResponse, null);
                }
                else
                {
                    localResponseContainer = new ResponseContainer(localStatusResponse, new Command(localStorage));
                }
                this.pairs.Add(localResponseContainer);
            }
        }
Example #2
0
 public ResponseContainer(StatusResponse paramStatusResponse, Command c)
 {
     this.status       = paramStatusResponse;
     this.response     = c;
     this.subResponses = null;
 }
Example #3
0
 public ResponseContainer(StatusResponse paramStatusResponse, Command c, List <Command> list)
 {
     this.status       = paramStatusResponse;
     this.response     = c;
     this.subResponses = list;
 }