[Quantproject-developers] QuantProject/b5_Presentation/Reporting/WindowsForm Report.cs, 1.18, 1.19
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2008-03-06 20:23:10
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv8690/b5_Presentation/Reporting/WindowsForm Modified Files: Report.cs Log Message: Bug fixed: in the previous version it was allowed to create the report twice. Now, an exception thrown if the Create() method is invoked and the report has already been previously created Index: Report.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm/Report.cs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Report.cs 27 Jan 2008 02:35:15 -0000 1.18 --- Report.cs 6 Mar 2008 20:23:04 -0000 1.19 *************** *** 50,53 **** --- 50,55 ---- private System.Windows.Forms.MenuItem saveTransactions; private SaveFileDialog saveFileDialog; + + private bool alreadyCreated = false; public AccountReport AccountReport *************** *** 136,139 **** --- 138,142 ---- showBenchmark ); this.Controls.Add( this.reportTabControl ); + this.alreadyCreated = true; } /// <summary> *************** *** 150,156 **** --- 153,166 ---- benchmark , true ); } + private void checkAlreadyCreated() + { + if ( this.alreadyCreated ) + throw new Exception( "The form content has already been " + + "created! You can create it just once!" ); + } public void Create( string reportName , int numDaysForInterval , EndOfDayDateTime endDateTime , string benchmark , bool showBenchmark ) { + this.checkAlreadyCreated(); create_set_accountReport( reportName , numDaysForInterval , endDateTime , benchmark ); |