Ejemplo n.º 1
0
 public Builder SetCredential(global::Alachisoft.NosDB.Common.Protobuf.Credential.Builder builderForValue)
 {
     pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
     PrepareBuilder();
     result.hasCredential = true;
     result.credential_   = builderForValue.Build();
     return(this);
 }
Ejemplo n.º 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(_createSessionCommandFieldNames, field_name, global::System.StringComparer.Ordinal);
                        if (field_ordinal >= 0)
                        {
                            tag = _createSessionCommandFieldTags[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 8: {
                        result.hasClientId = input.ReadInt32(ref result.clientId_);
                        break;
                    }

                    case 18: {
                        global::Alachisoft.NosDB.Common.Protobuf.Credential.Builder subBuilder = global::Alachisoft.NosDB.Common.Protobuf.Credential.CreateBuilder();
                        if (result.hasCredential)
                        {
                            subBuilder.MergeFrom(Credential);
                        }
                        input.ReadMessage(subBuilder, extensionRegistry);
                        Credential = subBuilder.BuildPartial();
                        break;
                    }
                    }
                }

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