Пример #1
0
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    input.SkipLastField();
                    break;

                case 8: {
                    Age = input.ReadInt32();
                    break;
                }

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

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

                case 32: {
                    sex_ = (global::Proto3Objects.Sex)input.ReadEnum();
                    break;
                }
                }
            }
        }
Пример #2
0
 public void MergeFrom(Person other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Age != 0)
     {
         Age = other.Age;
     }
     if (other.FirstName.Length != 0)
     {
         FirstName = other.FirstName;
     }
     if (other.LastName.Length != 0)
     {
         LastName = other.LastName;
     }
     if (other.Sex != 0)
     {
         Sex = other.Sex;
     }
 }