Example #1
0
 public void MergeFrom(DeprecatedFieldsMessage other)
 {
     if (other == null)
     {
         return;
     }
     if (other.PrimitiveValue != 0)
     {
         PrimitiveValue = other.PrimitiveValue;
     }
     primitiveArray_.Add(other.primitiveArray_);
     if (other.messageValue_ != null)
     {
         if (messageValue_ == null)
         {
             messageValue_ = new global::UnitTest.Issues.TestProtos.DeprecatedChild();
         }
         MessageValue.MergeFrom(other.MessageValue);
     }
     messageArray_.Add(other.messageArray_);
     if (other.EnumValue != global::UnitTest.Issues.TestProtos.DeprecatedEnum.DEPRECATED_ZERO)
     {
         EnumValue = other.EnumValue;
     }
     enumArray_.Add(other.enumArray_);
 }
Example #2
0
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

            while (input.ReadTag(out tag))
            {
                switch (tag)
                {
                case 0:
                    throw pb::InvalidProtocolBufferException.InvalidTag();

                default:
                    if (pb::WireFormat.IsEndGroupTag(tag))
                    {
                        return;
                    }
                    break;

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

                case 18:
                case 16: {
                    primitiveArray_.AddEntriesFrom(input, _repeated_primitiveArray_codec);
                    break;
                }

                case 26: {
                    if (messageValue_ == null)
                    {
                        messageValue_ = new global::UnitTest.Issues.TestProtos.DeprecatedChild();
                    }
                    input.ReadMessage(messageValue_);
                    break;
                }

                case 34: {
                    messageArray_.AddEntriesFrom(input, _repeated_messageArray_codec);
                    break;
                }

                case 40: {
                    enumValue_ = (global::UnitTest.Issues.TestProtos.DeprecatedEnum)input.ReadEnum();
                    break;
                }

                case 50:
                case 48: {
                    enumArray_.AddEntriesFrom(input, _repeated_enumArray_codec);
                    break;
                }
                }
            }
        }