public override PushInfo.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry)
            {
                this.PrepareBuilder();
                UnknownFieldSet.Builder builder = null;
                uint   num;
                string text;

                while (input.ReadTag(out num, out text))
                {
                    if (num == 0u && text != null)
                    {
                        int num2 = Array.BinarySearch <string>(PushInfo._pushInfoFieldNames, text, StringComparer.Ordinal);
                        if (num2 < 0)
                        {
                            if (builder == null)
                            {
                                builder = UnknownFieldSet.CreateBuilder(this.UnknownFields);
                            }
                            this.ParseUnknownField(input, builder, extensionRegistry, num, text);
                            continue;
                        }
                        num = PushInfo._pushInfoFieldTags[num2];
                    }
                    if (num <= 58u)
                    {
                        if (num <= 26u)
                        {
                            if (num <= 10u)
                            {
                                if (num == 0u)
                                {
                                    throw InvalidProtocolBufferException.InvalidTag();
                                }
                                if (num == 10u)
                                {
                                    this.result.hasMessage = input.ReadString(ref this.result.message_);
                                    continue;
                                }
                            }
                            else
                            {
                                if (num == 18u)
                                {
                                    this.result.hasActionKey = input.ReadString(ref this.result.actionKey_);
                                    continue;
                                }
                                if (num == 26u)
                                {
                                    this.result.hasSound = input.ReadString(ref this.result.sound_);
                                    continue;
                                }
                            }
                        }
                        else if (num <= 42u)
                        {
                            if (num == 34u)
                            {
                                this.result.hasBadge = input.ReadString(ref this.result.badge_);
                                continue;
                            }
                            if (num == 42u)
                            {
                                this.result.hasPayload = input.ReadString(ref this.result.payload_);
                                continue;
                            }
                        }
                        else
                        {
                            if (num == 50u)
                            {
                                this.result.hasLocKey = input.ReadString(ref this.result.locKey_);
                                continue;
                            }
                            if (num == 58u)
                            {
                                this.result.hasLocArgs = input.ReadString(ref this.result.locArgs_);
                                continue;
                            }
                        }
                    }
                    else if (num <= 88u)
                    {
                        if (num <= 74u)
                        {
                            if (num == 66u)
                            {
                                this.result.hasActionLocKey = input.ReadString(ref this.result.actionLocKey_);
                                continue;
                            }
                            if (num == 74u)
                            {
                                this.result.hasLaunchImage = input.ReadString(ref this.result.launchImage_);
                                continue;
                            }
                        }
                        else
                        {
                            if (num == 80u)
                            {
                                this.result.hasContentAvailable = input.ReadInt32(ref this.result.contentAvailable_);
                                continue;
                            }
                            if (num == 88u)
                            {
                                this.result.hasInvalidAPN = input.ReadBool(ref this.result.invalidAPN_);
                                continue;
                            }
                        }
                    }
                    else if (num <= 104u)
                    {
                        if (num == 98u)
                        {
                            this.result.hasApnJson = input.ReadString(ref this.result.apnJson_);
                            continue;
                        }
                        if (num == 104u)
                        {
                            this.result.hasInvalidMPN = input.ReadBool(ref this.result.invalidMPN_);
                            continue;
                        }
                    }
                    else
                    {
                        if (num == 114u)
                        {
                            this.result.hasMpnXml = input.ReadString(ref this.result.mpnXml_);
                            continue;
                        }
                        if (num == 120u)
                        {
                            this.result.hasValidNotify = input.ReadBool(ref this.result.validNotify_);
                            continue;
                        }
                        if (num == 130u)
                        {
                            NotifyInfo.Builder builder2 = NotifyInfo.CreateBuilder();
                            if (this.result.hasNotifyInfo)
                            {
                                builder2.MergeFrom(this.NotifyInfo);
                            }
                            input.ReadMessage(builder2, extensionRegistry);
                            this.NotifyInfo = builder2.BuildPartial();
                            continue;
                        }
                    }
                    if (WireFormat.IsEndGroupTag(num))
                    {
                        if (builder != null)
                        {
                            this.UnknownFields = builder.Build();
                        }
                        return(this);
                    }
                    if (builder == null)
                    {
                        builder = UnknownFieldSet.CreateBuilder(this.UnknownFields);
                    }
                    this.ParseUnknownField(input, builder, extensionRegistry, num, text);
                }
                if (builder != null)
                {
                    this.UnknownFields = builder.Build();
                }
                return(this);
            }
Beispiel #2
0
            public override PushInfo.Builder MergeFrom(
                ICodedInputStream input,
                ExtensionRegistry extensionRegistry)
            {
                this.PrepareBuilder();
                UnknownFieldSet.Builder unknownFields = (UnknownFieldSet.Builder)null;
                uint   fieldTag;
                string fieldName;

                while (input.ReadTag(out fieldTag, out fieldName))
                {
                    if (fieldTag == 0U && fieldName != null)
                    {
                        int index = Array.BinarySearch <string>(PushInfo._pushInfoFieldNames, fieldName, (IComparer <string>)StringComparer.Ordinal);
                        if (index >= 0)
                        {
                            fieldTag = PushInfo._pushInfoFieldTags[index];
                        }
                        else
                        {
                            if (unknownFields == null)
                            {
                                unknownFields = UnknownFieldSet.CreateBuilder(this.UnknownFields);
                            }
                            this.ParseUnknownField(input, unknownFields, extensionRegistry, fieldTag, fieldName);
                            continue;
                        }
                    }
                    switch (fieldTag)
                    {
                    case 0:
                        throw InvalidProtocolBufferException.InvalidTag();

                    case 10:
                        this.result.hasMessage = input.ReadString(ref this.result.message_);
                        continue;

                    case 18:
                        this.result.hasActionKey = input.ReadString(ref this.result.actionKey_);
                        continue;

                    case 26:
                        this.result.hasSound = input.ReadString(ref this.result.sound_);
                        continue;

                    case 34:
                        this.result.hasBadge = input.ReadString(ref this.result.badge_);
                        continue;

                    case 42:
                        this.result.hasPayload = input.ReadString(ref this.result.payload_);
                        continue;

                    case 50:
                        this.result.hasLocKey = input.ReadString(ref this.result.locKey_);
                        continue;

                    case 58:
                        this.result.hasLocArgs = input.ReadString(ref this.result.locArgs_);
                        continue;

                    case 66:
                        this.result.hasActionLocKey = input.ReadString(ref this.result.actionLocKey_);
                        continue;

                    case 74:
                        this.result.hasLaunchImage = input.ReadString(ref this.result.launchImage_);
                        continue;

                    case 80:
                        this.result.hasContentAvailable = input.ReadInt32(ref this.result.contentAvailable_);
                        continue;

                    case 88:
                        this.result.hasInvalidAPN = input.ReadBool(ref this.result.invalidAPN_);
                        continue;

                    case 98:
                        this.result.hasApnJson = input.ReadString(ref this.result.apnJson_);
                        continue;

                    case 104:
                        this.result.hasInvalidMPN = input.ReadBool(ref this.result.invalidMPN_);
                        continue;

                    case 114:
                        this.result.hasMpnXml = input.ReadString(ref this.result.mpnXml_);
                        continue;

                    case 120:
                        this.result.hasValidNotify = input.ReadBool(ref this.result.validNotify_);
                        continue;

                    case 130:
                        NotifyInfo.Builder builder = NotifyInfo.CreateBuilder();
                        if (this.result.hasNotifyInfo)
                        {
                            builder.MergeFrom(this.NotifyInfo);
                        }
                        input.ReadMessage((IBuilderLite)builder, extensionRegistry);
                        this.NotifyInfo = builder.BuildPartial();
                        continue;

                    default:
                        if (WireFormat.IsEndGroupTag(fieldTag))
                        {
                            if (unknownFields != null)
                            {
                                this.UnknownFields = unknownFields.Build();
                            }
                            return(this);
                        }
                        if (unknownFields == null)
                        {
                            unknownFields = UnknownFieldSet.CreateBuilder(this.UnknownFields);
                        }
                        this.ParseUnknownField(input, unknownFields, extensionRegistry, fieldTag, fieldName);
                        continue;
                    }
                }
                if (unknownFields != null)
                {
                    this.UnknownFields = unknownFields.Build();
                }
                return(this);
            }