示例#1
0
 public SnsActionGroup.Builder MergeReferAction(SnsAction value)
 {
     ThrowHelper.ThrowIfNull(value, "value");
     this.PrepareBuilder();
     if (this.result.hasReferAction && (this.result.referAction_ != SnsAction.DefaultInstance))
     {
         this.result.referAction_ = SnsAction.CreateBuilder(this.result.referAction_).MergeFrom(value).BuildPartial();
     }
     else
     {
         this.result.referAction_ = value;
     }
     this.result.hasReferAction = true;
     return(this);
 }
示例#2
0
            public override SnsActionGroup.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>(SnsActionGroup._snsActionGroupFieldNames, str, StringComparer.Ordinal);
                        if (index >= 0)
                        {
                            num = SnsActionGroup._snsActionGroupFieldTags[index];
                        }
                        else
                        {
                            this.ParseUnknownField(input, extensionRegistry, num, str);
                            continue;
                        }
                    }
                    switch (num)
                    {
                    case 0:
                        throw InvalidProtocolBufferException.InvalidTag();

                    case 8:
                    {
                        this.result.hasId = input.ReadUInt64(ref this.result.id_);
                        continue;
                    }

                    case 0x10:
                    {
                        this.result.hasParentId = input.ReadUInt64(ref this.result.parentId_);
                        continue;
                    }

                    case 0x1a:
                    {
                        SnsAction.Builder builder = SnsAction.CreateBuilder();
                        if (this.result.hasCurrentAction)
                        {
                            builder.MergeFrom(this.CurrentAction);
                        }
                        input.ReadMessage(builder, extensionRegistry);
                        this.CurrentAction = builder.BuildPartial();
                        continue;
                    }

                    case 0x22:
                    {
                        SnsAction.Builder builder2 = SnsAction.CreateBuilder();
                        if (this.result.hasReferAction)
                        {
                            builder2.MergeFrom(this.ReferAction);
                        }
                        input.ReadMessage(builder2, extensionRegistry);
                        this.ReferAction = builder2.BuildPartial();
                        continue;
                    }
                    }
                    if (WireFormat.IsEndGroupTag(num))
                    {
                        return(this);
                    }
                    this.ParseUnknownField(input, extensionRegistry, num, str);
                }
                return(this);
            }