Ejemplo n.º 1
0
 public DisturbSetting.Builder SetNightTime(DisturbTimeSpan value)
 {
     ThrowHelper.ThrowIfNull(value, "value");
     this.PrepareBuilder();
     this.result.hasNightTime = true;
     this.result.nightTime_   = value;
     return(this);
 }
Ejemplo n.º 2
0
 public DisturbSetting.Builder MergeNightTime(DisturbTimeSpan value)
 {
     ThrowHelper.ThrowIfNull(value, "value");
     this.PrepareBuilder();
     if (this.result.hasNightTime && (this.result.nightTime_ != DisturbTimeSpan.DefaultInstance))
     {
         this.result.nightTime_ = DisturbTimeSpan.CreateBuilder(this.result.nightTime_).MergeFrom(value).BuildPartial();
     }
     else
     {
         this.result.nightTime_ = value;
     }
     this.result.hasNightTime = true;
     return(this);
 }
Ejemplo n.º 3
0
            public override DisturbSetting.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>(DisturbSetting._disturbSettingFieldNames, str, StringComparer.Ordinal);
                        if (index >= 0)
                        {
                            num = DisturbSetting._disturbSettingFieldTags[index];
                        }
                        else
                        {
                            this.ParseUnknownField(input, extensionRegistry, num, str);
                            continue;
                        }
                    }
                    switch (num)
                    {
                    case 0:
                        throw InvalidProtocolBufferException.InvalidTag();

                    case 8:
                    {
                        this.result.hasNightSetting = input.ReadUInt32(ref this.result.nightSetting_);
                        continue;
                    }

                    case 0x12:
                    {
                        DisturbTimeSpan.Builder builder = DisturbTimeSpan.CreateBuilder();
                        if (this.result.hasNightTime)
                        {
                            builder.MergeFrom(this.NightTime);
                        }
                        input.ReadMessage(builder, extensionRegistry);
                        this.NightTime = builder.BuildPartial();
                        continue;
                    }

                    case 0x18:
                    {
                        this.result.hasAllDaySetting = input.ReadUInt32(ref this.result.allDaySetting_);
                        continue;
                    }

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