[Quantproject-developers] QuantProject/b5_Presentation/Reporting/WindowsForm Report.cs,1.14,1.15
Brought to you by:
glauco_1
|
From: Marco M. <mi...@us...> - 2005-08-01 22:27:40
|
Update of /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16034/b5_Presentation/Reporting/WindowsForm Modified Files: Report.cs Log Message: Added new menu item for saving genomes Index: Report.cs =================================================================== RCS file: /cvsroot/quantproject/QuantProject/b5_Presentation/Reporting/WindowsForm/Report.cs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Report.cs 10 Jun 2005 18:45:44 -0000 1.14 --- Report.cs 1 Aug 2005 22:27:31 -0000 1.15 *************** *** 28,31 **** --- 28,32 ---- using QuantProject.Business.Timing; + namespace QuantProject.Presentation.Reporting.WindowsForm { *************** *** 46,49 **** --- 47,51 ---- private System.Windows.Forms.MenuItem saveReport; private System.Windows.Forms.MenuItem saveTransactions; + private System.Windows.Forms.MenuItem saveGenomes; private SaveFileDialog saveFileDialog; *************** *** 90,93 **** --- 92,98 ---- this.saveTransactions.Text = "Save Transactions"; + this.saveGenomes = new MenuItem(); + this.saveGenomes.Text = "Save Genomes"; + this.file = new MenuItem(); this.file.Text = "File"; *************** *** 97,105 **** this.file.MenuItems.AddRange(new MenuItem[] {this.saveAccount, ! this.saveReport, this.saveTransactions}); this.Menu = this.mainMenu; this.saveAccount.Click += new System.EventHandler(this.saveAccount_Click); this.saveReport.Click += new System.EventHandler(this.saveReport_Click); ! this.saveTransactions.Click += new System.EventHandler(this.saveTransactions_Click); } --- 102,113 ---- this.file.MenuItems.AddRange(new MenuItem[] {this.saveAccount, ! this.saveReport, ! this.saveTransactions, ! this.saveGenomes}); this.Menu = this.mainMenu; this.saveAccount.Click += new System.EventHandler(this.saveAccount_Click); this.saveReport.Click += new System.EventHandler(this.saveReport_Click); ! this.saveTransactions.Click += new System.EventHandler(this.saveTransactions_Click); ! this.saveGenomes.Click += new System.EventHandler(this.saveGenomes_Click); } *************** *** 169,173 **** } ! #region save account or report or transactions private void saveAccount_Click(object sender, System.EventArgs e) --- 177,181 ---- } ! #region save account or report or transactions or genomes private void saveAccount_Click(object sender, System.EventArgs e) *************** *** 187,190 **** --- 195,203 ---- } + private void saveGenomes_Click(object sender, System.EventArgs e) + { + this.saveObject((MenuItem)sender); + } + private void saveObject_setSaveFileDialog(MenuItem sender) { *************** *** 212,216 **** this.saveFileDialog.DefaultExt = "qPt"; } ! this.saveFileDialog.AddExtension = true; this.saveFileDialog.CreatePrompt = true; --- 225,235 ---- this.saveFileDialog.DefaultExt = "qPt"; } ! else if(sender.Text.EndsWith("Genomes")) ! //else the text property of the menu item sender contains at the end ! // the word "Genomes"; so it will be saved an OptimizationOutput ! //containing a GenomeRepresentation ! { ! this.saveFileDialog.DefaultExt = "bgn"; ! } this.saveFileDialog.AddExtension = true; this.saveFileDialog.CreatePrompt = true; *************** *** 240,243 **** --- 259,265 ---- QuantProject.ADT.FileManaging.ObjectArchiver.Archive(this.account.Transactions, this.saveFileDialog.FileName); + else if(((SaveFileDialog)sender).Title.EndsWith("Genomes")) + QuantProject.ADT.FileManaging.ObjectArchiver.Archive(this.account.OptimizationOutput, + this.saveFileDialog.FileName); } |