示例#1
0
        public static AddContactResponse Parse(byte[] bytes)
        {
            using (MemoryStream stream = new MemoryStream(bytes))
                using (BinaryReader reader = new BinaryReader(stream))
                {
                    ResponseType responseType = (ResponseType)reader.ReadInt32();
                    if (responseType != ResponseType.AddContact)
                    {
                        throw new InvalidOperationException("Invalid type of response");
                    }

                    AddContactResult result = (AddContactResult)reader.ReadInt32();

                    return(new AddContactResponse(result));
                }
        }
示例#2
0
 public AddContactResponse(AddContactResult result)
 {
     Result = result;
 }