Esempio n. 1
0
 /// <summary>Updates from data described by src.</summary>
 /// <param name="src">Source for the update.</param>
 public void UpdateFrom(RealTimeStationInformationType src)
 {
     if (src != null)
     {
         if (string.Compare(this.StationCode, src.StationCode) == 0)
         {
             this.StationData = (src.StationData != null) ? src.StationData.Clone() : null;
             SetUpdateDate(DateTime.Now);
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Clones this instance.
        /// </summary>
        /// <returns>The cloned instance</returns>
        public RealTimeStationDataType Clone()
        {
            RealTimeStationDataType clonedObject = new RealTimeStationDataType()
            {
                StationWeather = this.StationWeather != null?this.StationWeather.Clone() : null,
                                     StationPlatform = this.StationPlatform != null?this.StationPlatform.Clone() : null,
                                                           StationDelay = this.StationDelay != null?this.StationDelay.Clone() : null
            };

            if (this.StationConnectionList != null)
            {
                clonedObject.StationConnectionList          = new List <RealTimeStationConnectionType>();
                clonedObject.StationConnectionList.Capacity = this.StationConnectionList.Count;
                clonedObject.StationConnectionList.AddRange(this.StationConnectionList.Select(connection => connection.Clone()));
            }
            return(clonedObject);
        }