///////////////////////////////////////////////////////////////////////
        #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);
        }
Пример #2
0
        ///////////////////////////////////////////////////////////////////////
        #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);
        }
Пример #3
0
 /// <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));
 }
Пример #4
0
 /// <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));
 }
Пример #5
0
 /// <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));
 }
Пример #6
0
 /// <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);
 }
Пример #7
0
 /// <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);
 }