Update of /cvsroot/quantproject/QuantProject/b3_Data/DataTables
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv15565/b3_Data/DataTables
Modified Files:
Quotes.cs
Log Message:
The removeNonContainedDates private method has been fixed (to say the truth, never used yet, so it may still require some tuning...)
Index: Quotes.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b3_Data/DataTables/Quotes.cs,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** Quotes.cs 22 Jul 2006 20:56:09 -0000 1.28
--- Quotes.cs 30 Jul 2006 13:55:39 -0000 1.29
***************
*** 59,69 ****
this.removeNonContainedDates( marketDays );
}
! private void removeNonContainedDates( SortedList marketDays )
{
foreach( DataRow dataRow in this.Rows )
! if ( marketDays.ContainsKey(
(DateTime)dataRow[ Quotes.Date ] ) )
! this.Rows.Remove( dataRow );
}
public Quotes( string ticker )
{
--- 59,87 ----
this.removeNonContainedDates( marketDays );
}
! #region removeNonContainedDates
! private ArrayList removeNonContainedDates_getDataRowsToBeRemoved(
! SortedList marketDays )
{
+ ArrayList dataRowsToBeRemoved = new ArrayList();
foreach( DataRow dataRow in this.Rows )
! if ( !marketDays.ContainsKey(
(DateTime)dataRow[ Quotes.Date ] ) )
! dataRowsToBeRemoved.Add( dataRow );
! return dataRowsToBeRemoved;
! }
! private void removeDataRows( ICollection dataRowsToBeRemoved )
! {
! foreach ( DataRow dataRowToBeRemoved in dataRowsToBeRemoved )
! this.Rows.Remove( dataRowToBeRemoved );
! }
! private void removeNonContainedDates( SortedList marketDays )
! {
! ArrayList dataRowsToBeRemoved =
! this.removeNonContainedDates_getDataRowsToBeRemoved(
! marketDays );
! this.removeDataRows( dataRowsToBeRemoved );
}
+ #endregion
+
public Quotes( string ticker )
{
|