예제 #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);
        }
예제 #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);
 }