/////////////////////////////////////////////////////////////////////// #region ICloneable Members /// <summary> /// Creates a deep copy of the object. /// </summary> public virtual object Clone() { // clone simple properies. TsCHdaTrend clone = (TsCHdaTrend)MemberwiseClone(); // clone items. clone._items = new TsCHdaItemCollection(); foreach (TsCHdaItem item in _items) { clone._items.Add(item.Clone()); } // clone timestamps. clone._timeStamps = new TsCHdaItemTimeCollection(); foreach (DateTime timestamp in _timeStamps) { clone._timeStamps.Add(timestamp); } // clear dynamic state information. clone._subscription = null; clone._playback = null; return(clone); }
/////////////////////////////////////////////////////////////////////// #region ISerializable Members /// <summary> /// Serializes a server into a stream. /// </summary> public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); TsCHdaTrend[] trends = null; if (_trends.Count > 0) { trends = new TsCHdaTrend[_trends.Count]; for (int ii = 0; ii < trends.Length; ii++) { trends[ii] = _trends[ii]; } } info.AddValue(Names.TRENDS, trends); }
/// <summary> /// Adds an item to the IList. /// </summary> /// <param name="value">The Object to add to the IList. </param> /// <returns>The position into which the new element was inserted.</returns> public int Add(TsCHdaTrend value) { return(Add((object)value)); }
/// <summary> /// Determines the index of a specific item in the IList. /// </summary> /// <param name="value">The Object to locate in the IList.</param> /// <returns>The index of value if found in the list; otherwise, -1.</returns> public int IndexOf(TsCHdaTrend value) { return(IndexOf((object)value)); }
/// <summary> /// Determines whether the IList contains a specific value. /// </summary> /// <param name="value">The Object to locate in the IList.</param> /// <returns>true if the Object is found in the IList; otherwise, false.</returns> public bool Contains(TsCHdaTrend value) { return(Contains((object)value)); }
/// <summary> /// Removes the first occurrence of a specific object from the IList. /// </summary> /// <param name="value">The Object to remove from the IList.</param> public void Remove(TsCHdaTrend value) { Remove((object)value); }
/// <summary> /// Inserts an item to the IList at the specified position. /// </summary> /// <param name="index">The zero-based index at which value should be inserted.</param> /// <param name="value">The Object to insert into the IList. </param> public void Insert(int index, TsCHdaTrend value) { Insert(index, (object)value); }