FieldSet
public override Builder MergeFrom(IMessage other) { if (other.DescriptorForType != type) { throw new ArgumentException("MergeFrom(IMessage) can only merge messages of the same type."); } fields.MergeFrom(other); MergeUnknownFields(other.UnknownFields); for (int i = 0; i < oneofCase.Length; i++) { if (other.HasOneof(type.Oneofs[i])) { if (oneofCase[i] == null) { oneofCase[i] = other.OneofFieldDescriptor(type.Oneofs[i]); } else { if (oneofCase[i] != other.OneofFieldDescriptor(type.Oneofs[i])) { fields.ClearField(oneofCase[i]); oneofCase[i] = other.OneofFieldDescriptor(type.Oneofs[i]); } } } } return(this); }
public override Builder MergeFrom(IMessage other) { if (other.DescriptorForType != type) { throw new ArgumentException("MergeFrom(IMessage) can only merge messages of the same type."); } fields.MergeFrom(other); MergeUnknownFields(other.UnknownFields); return(this); }