Exemplo n.º 1
0
 public SendAppMsgRequest.Builder SetMsg(AppMsg value)
 {
     ThrowHelper.ThrowIfNull(value, "value");
     this.PrepareBuilder();
     this.result.hasMsg = true;
     this.result.msg_   = value;
     return(this);
 }
Exemplo n.º 2
0
 public SendAppMsgRequest.Builder MergeMsg(AppMsg value)
 {
     ThrowHelper.ThrowIfNull(value, "value");
     this.PrepareBuilder();
     if (this.result.hasMsg && (this.result.msg_ != AppMsg.DefaultInstance))
     {
         this.result.msg_ = AppMsg.CreateBuilder(this.result.msg_).MergeFrom(value).BuildPartial();
     }
     else
     {
         this.result.msg_ = value;
     }
     this.result.hasMsg = true;
     return(this);
 }
Exemplo n.º 3
0
            public override SendAppMsgRequest.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry)
            {
                uint   num;
                string str;

                this.PrepareBuilder();
                while (input.ReadTag(out num, out str))
                {
                    if ((num == 0) && (str != null))
                    {
                        int index = Array.BinarySearch <string>(SendAppMsgRequest._sendAppMsgRequestFieldNames, str, StringComparer.Ordinal);
                        if (index >= 0)
                        {
                            num = SendAppMsgRequest._sendAppMsgRequestFieldTags[index];
                        }
                        else
                        {
                            this.ParseUnknownField(input, extensionRegistry, num, str);
                            continue;
                        }
                    }
                    switch (num)
                    {
                    case 0:
                        throw InvalidProtocolBufferException.InvalidTag();

                    case 10:
                    {
                        micromsg.BaseRequest.Builder builder = micromsg.BaseRequest.CreateBuilder();
                        if (this.result.hasBaseRequest)
                        {
                            builder.MergeFrom(this.BaseRequest);
                        }
                        input.ReadMessage(builder, extensionRegistry);
                        this.BaseRequest = builder.BuildPartial();
                        continue;
                    }

                    case 0x12:
                    {
                        AppMsg.Builder builder2 = AppMsg.CreateBuilder();
                        if (this.result.hasMsg)
                        {
                            builder2.MergeFrom(this.Msg);
                        }
                        input.ReadMessage(builder2, extensionRegistry);
                        this.Msg = builder2.BuildPartial();
                        continue;
                    }

                    case 0x1a:
                        break;

                    default:
                    {
                        if (WireFormat.IsEndGroupTag(num))
                        {
                            return(this);
                        }
                        this.ParseUnknownField(input, extensionRegistry, num, str);
                        continue;
                    }
                    }
                    this.result.hasCommentUrl = input.ReadString(ref this.result.commentUrl_);
                }
                return(this);
            }