Exemple #1
0
        public void MergeFrom(ChatRequest other)
        {
            if (other == null)
            {
                return;
            }
            if (other.Type != global::Chat.Protocol.ChatRequest.Types.Type.Unkown)
            {
                Type = other.Type;
            }
            switch (other.PayloadCase)
            {
            case PayloadOneofCase.User:
                if (User == null)
                {
                    User = new global::Chat.Protocol.User();
                }
                User.MergeFrom(other.User);
                break;

            case PayloadOneofCase.Message:
                if (Message == null)
                {
                    Message = new global::Chat.Protocol.Message();
                }
                Message.MergeFrom(other.Message);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
Exemple #2
0
 public void MergeFrom(ChatResponse other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Type != global::Chat.Protocol.ChatResponse.Types.Type.Unknown)
     {
         Type = other.Type;
     }
     if (other.Error.Length != 0)
     {
         Error = other.Error;
     }
     friends_.Add(other.friends_);
     if (other.user_ != null)
     {
         if (user_ == null)
         {
             User = new global::Chat.Protocol.User();
         }
         User.MergeFrom(other.User);
     }
     if (other.message_ != null)
     {
         if (message_ == null)
         {
             Message = new global::Chat.Protocol.Message();
         }
         Message.MergeFrom(other.Message);
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
Exemple #3
0
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                    break;

                case 8: {
                    Type = (global::Chat.Protocol.ChatResponse.Types.Type)input.ReadEnum();
                    break;
                }

                case 18: {
                    Error = input.ReadString();
                    break;
                }

                case 26: {
                    friends_.AddEntriesFrom(input, _repeated_friends_codec);
                    break;
                }

                case 34: {
                    if (user_ == null)
                    {
                        User = new global::Chat.Protocol.User();
                    }
                    input.ReadMessage(User);
                    break;
                }

                case 42: {
                    if (message_ == null)
                    {
                        Message = new global::Chat.Protocol.Message();
                    }
                    input.ReadMessage(Message);
                    break;
                }
                }
            }
        }
Exemple #4
0
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                    break;

                case 8: {
                    Type = (global::Chat.Protocol.ChatRequest.Types.Type)input.ReadEnum();
                    break;
                }

                case 18: {
                    global::Chat.Protocol.User subBuilder = new global::Chat.Protocol.User();
                    if (payloadCase_ == PayloadOneofCase.User)
                    {
                        subBuilder.MergeFrom(User);
                    }
                    input.ReadMessage(subBuilder);
                    User = subBuilder;
                    break;
                }

                case 26: {
                    global::Chat.Protocol.Message subBuilder = new global::Chat.Protocol.Message();
                    if (payloadCase_ == PayloadOneofCase.Message)
                    {
                        subBuilder.MergeFrom(Message);
                    }
                    input.ReadMessage(subBuilder);
                    Message = subBuilder;
                    break;
                }
                }
            }
        }