Ejemplo n.º 1
0
 public void MergeFrom(Person other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Name.Length != 0)
     {
         Name = other.Name;
     }
     if (other.Id != 0)
     {
         Id = other.Id;
     }
     if (other.Email.Length != 0)
     {
         Email = other.Email;
     }
     if (other.phone_ != null)
     {
         if (phone_ == null)
         {
             phone_ = new global::Person.Types.PhoneNumber();
         }
         Phone.MergeFrom(other.Phone);
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
Ejemplo n.º 2
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 10: {
                Name = input.ReadString();
                break;
            }

            case 16: {
                Id = input.ReadInt32();
                break;
            }

            case 26: {
                Email = input.ReadString();
                break;
            }

            case 34: {
                if (phone_ == null)
                {
                    phone_ = new global::Person.Types.PhoneNumber();
                }
                input.ReadMessage(phone_);
                break;
            }
            }
        }
    }