/// <summary> /// Copy constructor. Returns a deep clone /// </summary> /// <param name="TS"></param> public TimestampSeries2(TimestampSeries2 TS) { foreach (var i in TS.Items) Items.Add(i); this.Id = TS.Id; this.IsSorted = TS.IsSorted; this.Name = TS.name; this.RelaxationFactor = TS.relaxationFactor; //Problem with the next two as they should really be cloned. this.Tag = TS.Tag; this.Unit = TS.Unit; this.AllowExtrapolation = TS.AllowExtrapolation; this.Description = TS.Description; }
public override void Load(FileStream fileStream) { //XmlSerializer serializer = new XmlSerializer(typeof(TimestampSeries)); //TimestampSeries ts = (TimestampSeries)serializer.Deserialize(fileStream); DataContractSerializer dc = new DataContractSerializer(typeof(TimestampSeries2)); TimestampSeries2 ts = (TimestampSeries2)dc.ReadObject(fileStream); this.name = ts.Name; this.id = ts.Id; this.relaxationFactor = ts.RelaxationFactor; this.unit = new Unit(ts.unit); this.items.Clear(); foreach (TimestampValue tsv in ts.Items) { items.Add(new TimestampValue(tsv)); } }
/// <summary> /// Copy constructor. Returns a deep clone /// </summary> /// <param name="TS"></param> public TimestampSeries2(TimestampSeries2 TS) { foreach (var i in TS.Items) { Items.Add(i); } this.Id = TS.Id; this.IsSorted = TS.IsSorted; this.Name = TS.name; this.RelaxationFactor = TS.relaxationFactor; //Problem with the next two as they should really be cloned. this.Tag = TS.Tag; this.Unit = TS.Unit; this.AllowExtrapolation = TS.AllowExtrapolation; this.Description = TS.Description; }