コード例 #1
0
 public Builder SetHeader(global::lth.egmTest.Header.Builder builderForValue)
 {
     pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
     PrepareBuilder();
     result.hasHeader = true;
     result.header_   = builderForValue.Build();
     return(this);
 }
コード例 #2
0
            public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry)
            {
                PrepareBuilder();
                pb::UnknownFieldSet.Builder unknownFields = null;
                uint   tag;
                string field_name;

                while (input.ReadTag(out tag, out field_name))
                {
                    if (tag == 0 && field_name != null)
                    {
                        int field_ordinal = global::System.Array.BinarySearch(_packetFieldNames, field_name, global::System.StringComparer.Ordinal);
                        if (field_ordinal >= 0)
                        {
                            tag = _packetFieldTags[field_ordinal];
                        }
                        else
                        {
                            if (unknownFields == null)
                            {
                                unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
                            }
                            ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
                            continue;
                        }
                    }
                    switch (tag)
                    {
                    case 0: {
                        throw pb::InvalidProtocolBufferException.InvalidTag();
                    }

                    default: {
                        if (pb::WireFormat.IsEndGroupTag(tag))
                        {
                            if (unknownFields != null)
                            {
                                this.UnknownFields = unknownFields.Build();
                            }
                            return(this);
                        }
                        if (unknownFields == null)
                        {
                            unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
                        }
                        ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
                        break;
                    }

                    case 10: {
                        global::lth.egmTest.Header.Builder subBuilder = global::lth.egmTest.Header.CreateBuilder();
                        if (result.hasHeader)
                        {
                            subBuilder.MergeFrom(Header);
                        }
                        input.ReadMessage(subBuilder, extensionRegistry);
                        Header = subBuilder.BuildPartial();
                        break;
                    }

                    case 18: {
                        global::lth.egmTest.Body.Builder subBuilder = global::lth.egmTest.Body.CreateBuilder();
                        if (result.hasBody)
                        {
                            subBuilder.MergeFrom(Body);
                        }
                        input.ReadMessage(subBuilder, extensionRegistry);
                        Body = subBuilder.BuildPartial();
                        break;
                    }
                    }
                }

                if (unknownFields != null)
                {
                    this.UnknownFields = unknownFields.Build();
                }
                return(this);
            }