MergeFrom() 공개 메소드

Like MergeFrom(IMessage), but merges from another FieldSet.
public MergeFrom ( FieldSet other ) : void
other FieldSet
리턴 void
예제 #1
0
 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);
 }
예제 #2
0
 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);
 }