/// <summary> /// Clone Dss TimeSpan /// </summary> public virtual object Clone() { DssTimeSpan target = new DssTimeSpan(); target.Ticks = this.Ticks; return(target); }
/// <summary> /// Copy To Dss TimeSpan /// </summary> public virtual void CopyTo(IDssSerializable target) { if (target == null) { target = new DssTimeSpan(); } DssTimeSpan typedTarget = target as DssTimeSpan; if (typedTarget == null) { throw new ArgumentException("CopyTo({0}) requires type {0}", this.GetType().FullName); } typedTarget.Ticks = this.Ticks; }
/// <summary> /// Allows comparison of this instance with another DssTimeSpan or TimeSpan. /// </summary> /// <param name="obj"></param> /// <returns></returns> int IComparable.CompareTo(object obj) { if (obj == null) { return((this._time == null) ? 0 : 1); } DssTimeSpan target = obj as DssTimeSpan; if (target == null) { if (obj.GetType() == typeof(TimeSpan)) { return(this.ToTimeSpan().CompareTo(obj)); } throw new ArgumentException(string.Format("{0} cannot be compared to DssTimeSpan", obj.GetType())); } return(this.Ticks.CompareTo(target.Ticks)); }