Exemple #1
0
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                    break;

                case 10: {
                    Id = input.ReadString();
                    break;
                }

                case 18: {
                    if (creationTime_ == null)
                    {
                        CreationTime = new global::Google.Protobuf.WellKnownTypes.Timestamp();
                    }
                    input.ReadMessage(CreationTime);
                    break;
                }

                case 26: {
                    if (date_ == null)
                    {
                        Date = new global::Google.Protobuf.WellKnownTypes.Timestamp();
                    }
                    input.ReadMessage(Date);
                    break;
                }

                case 34: {
                    City = input.ReadString();
                    break;
                }

                case 40: {
                    Context = (global::Forecast.Context)input.ReadEnum();
                    break;
                }

                case 48: {
                    TemperatureC = input.ReadInt32();
                    break;
                }

                case 56: {
                    Summary = (global::Forecast.Summary)input.ReadEnum();
                    break;
                }
                }
            }
        }
Exemple #2
0
 public void MergeFrom(WeatherForecast other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Id.Length != 0)
     {
         Id = other.Id;
     }
     if (other.creationTime_ != null)
     {
         if (creationTime_ == null)
         {
             CreationTime = new global::Google.Protobuf.WellKnownTypes.Timestamp();
         }
         CreationTime.MergeFrom(other.CreationTime);
     }
     if (other.date_ != null)
     {
         if (date_ == null)
         {
             Date = new global::Google.Protobuf.WellKnownTypes.Timestamp();
         }
         Date.MergeFrom(other.Date);
     }
     if (other.City.Length != 0)
     {
         City = other.City;
     }
     if (other.Context != global::Forecast.Context.InSun)
     {
         Context = other.Context;
     }
     if (other.TemperatureC != 0)
     {
         TemperatureC = other.TemperatureC;
     }
     if (other.Summary != global::Forecast.Summary.Freezing)
     {
         Summary = other.Summary;
     }
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }