Пример #1
0
 public void MergeFrom(OnlineOrderResponse other)
 {
     if (other == null)
     {
         return;
     }
     if (other.Id.Length != 0)
     {
         Id = other.Id;
     }
     if (other.Loading != false)
     {
         Loading = other.Loading;
     }
     if (other.OfflineFulfillment != false)
     {
         OfflineFulfillment = other.OfflineFulfillment;
     }
     if (other.TrainDescription.Length != 0)
     {
         TrainDescription = other.TrainDescription;
     }
     if (other.railway_ != null)
     {
         if (railway_ == null)
         {
             Railway = new global::G2Rail.Protobuf.Railway();
         }
         Railway.MergeFrom(other.Railway);
     }
     if (other.from_ != null)
     {
         if (from_ == null)
         {
             From = new global::G2Rail.Protobuf.Station();
         }
         From.MergeFrom(other.From);
     }
     if (other.to_ != null)
     {
         if (to_ == null)
         {
             To = new global::G2Rail.Protobuf.Station();
         }
         To.MergeFrom(other.To);
     }
     if (other.Departure.Length != 0)
     {
         Departure = other.Departure;
     }
     if (other.Arrival.Length != 0)
     {
         Arrival = other.Arrival;
     }
     if (other.ticketPrice_ != null)
     {
         if (ticketPrice_ == null)
         {
             TicketPrice = new global::G2Rail.Protobuf.Price();
         }
         TicketPrice.MergeFrom(other.TicketPrice);
     }
     if (other.paymentPrice_ != null)
     {
         if (paymentPrice_ == null)
         {
             PaymentPrice = new global::G2Rail.Protobuf.Price();
         }
         PaymentPrice.MergeFrom(other.PaymentPrice);
     }
     if (other.chargingPrice_ != null)
     {
         if (chargingPrice_ == null)
         {
             ChargingPrice = new global::G2Rail.Protobuf.Price();
         }
         ChargingPrice.MergeFrom(other.ChargingPrice);
     }
     if (other.rebateAmount_ != null)
     {
         if (rebateAmount_ == null)
         {
             RebateAmount = new global::G2Rail.Protobuf.Price();
         }
         RebateAmount.MergeFrom(other.RebateAmount);
     }
     trains_.Add(other.trains_);
     passengers_.Add(other.passengers_);
     tickets_.Add(other.tickets_);
     records_.Add(other.records_);
     _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
 }
Пример #2
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 (railway_ == null)
                    {
                        Railway = new global::G2Rail.Protobuf.Railway();
                    }
                    input.ReadMessage(Railway);
                    break;
                }

                case 26: {
                    if (from_ == null)
                    {
                        From = new global::G2Rail.Protobuf.Station();
                    }
                    input.ReadMessage(From);
                    break;
                }

                case 34: {
                    if (to_ == null)
                    {
                        To = new global::G2Rail.Protobuf.Station();
                    }
                    input.ReadMessage(To);
                    break;
                }

                case 42: {
                    Departure = input.ReadString();
                    break;
                }

                case 50: {
                    Arrival = input.ReadString();
                    break;
                }

                case 58: {
                    if (ticketPrice_ == null)
                    {
                        TicketPrice = new global::G2Rail.Protobuf.Price();
                    }
                    input.ReadMessage(TicketPrice);
                    break;
                }

                case 66: {
                    if (paymentPrice_ == null)
                    {
                        PaymentPrice = new global::G2Rail.Protobuf.Price();
                    }
                    input.ReadMessage(PaymentPrice);
                    break;
                }

                case 74: {
                    if (chargingPrice_ == null)
                    {
                        ChargingPrice = new global::G2Rail.Protobuf.Price();
                    }
                    input.ReadMessage(ChargingPrice);
                    break;
                }

                case 82: {
                    if (rebateAmount_ == null)
                    {
                        RebateAmount = new global::G2Rail.Protobuf.Price();
                    }
                    input.ReadMessage(RebateAmount);
                    break;
                }

                case 90: {
                    passengers_.AddEntriesFrom(input, _repeated_passengers_codec);
                    break;
                }

                case 98: {
                    tickets_.AddEntriesFrom(input, _repeated_tickets_codec);
                    break;
                }

                case 106: {
                    records_.AddEntriesFrom(input, _repeated_records_codec);
                    break;
                }

                case 112: {
                    Loading = input.ReadBool();
                    break;
                }

                case 120: {
                    OfflineFulfillment = input.ReadBool();
                    break;
                }

                case 130: {
                    TrainDescription = input.ReadString();
                    break;
                }

                case 138: {
                    trains_.AddEntriesFrom(input, _repeated_trains_codec);
                    break;
                }
                }
            }
        }