[Quantproject-developers] QuantProject/b1_ADT/Histories History.cs, 1.12, 1.13
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2008-01-19 19:03:08
|
Update of /cvsroot/quantproject/QuantProject/b1_ADT/Histories In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv16813/b1_ADT/Histories Modified Files: History.cs Log Message: - The property FirstDateTime has been included - The property LastDateTime has been included Index: History.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b1_ADT/Histories/History.cs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** History.cs 26 Sep 2007 21:58:18 -0000 1.12 --- History.cs 19 Jan 2008 19:03:05 -0000 1.13 *************** *** 44,51 **** get { return this.Keys; } } public History() : base() { } ! public Object GetValue( DateTime dateTime ) { --- 44,81 ---- get { return this.Keys; } } + + /// <summary> + /// The first DateTime value in the TimeLine + /// </summary> + public DateTime FirstDateTime + { + get + { + if ( this.TimeLine.Count == 0 ) + throw new Exception( "This History collection is empty, " + + "thus FirstDateTime is meaningless!" ); + return (DateTime)(this.GetKey( 0 )); + } + } + + /// <summary> + /// The last DateTime value in the TimeLine + /// </summary> + public DateTime LastDateTime + { + get + { + if ( this.TimeLine.Count == 0 ) + throw new Exception( "This History collection is empty, " + + "thus LastDateTime is meaningless!" ); + int lastIndex = this.TimeLine.Count - 1; + return (DateTime)( this.GetKey( lastIndex ) ); + } + } + public History() : base() { } ! public Object GetValue( DateTime dateTime ) { |