- Timestamp:
- 08/10/09 16:21:09 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.CEDMA.Core/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.Core/3.3/Console.cs
r2223 r2273 33 33 namespace HeuristicLab.CEDMA.Core { 34 34 public class Console : ItemBase, IEditable { 35 private static readonly string sqlServerCompactFile = AppDomain.CurrentDomain.BaseDirectory + "HeuristicLab.Modeling.database.sdf"; 36 private static readonly string sqlServerCompactConnectionString = @"Data Source=" + sqlServerCompactFile; 35 private static readonly string sqlServerCompactConnectionString = @"Data Source="; 36 37 private string database; 38 public string Database { 39 get { 40 return database; 41 } 42 set { 43 if (value != database) { 44 database = value; 45 results = null; 46 } 47 } 48 } 37 49 38 50 private Results results; … … 56 68 57 69 private void ReloadResults() { 58 results = new Results(new DatabaseService(sqlServerCompactConnectionString ));70 results = new Results(new DatabaseService(sqlServerCompactConnectionString + Database)); 59 71 } 60 72 } -
trunk/sources/HeuristicLab.CEDMA.Core/3.3/ConsoleEditor.cs
r2223 r2273 34 34 private ComboBox viewComboBox; 35 35 private Button resultsButton; 36 private Button openButton; 36 37 private Console console; 37 38 … … 39 40 InitializeComponent(); 40 41 this.console = console; 42 resultsButton.Enabled = false; 43 viewComboBox.Enabled = false; 41 44 PopulateViewComboBox(); 42 45 } … … 46 49 this.viewComboBox = new System.Windows.Forms.ComboBox(); 47 50 this.resultsButton = new System.Windows.Forms.Button(); 51 this.openButton = new System.Windows.Forms.Button(); 48 52 this.SuspendLayout(); 49 53 // 50 54 // viewComboBox 51 55 // 52 this.viewComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));53 56 this.viewComboBox.FormattingEnabled = true; 54 this.viewComboBox.Location = new System.Drawing.Point( 3, 3);57 this.viewComboBox.Location = new System.Drawing.Point(0, 29); 55 58 this.viewComboBox.Name = "viewComboBox"; 56 59 this.viewComboBox.Size = new System.Drawing.Size(121, 21); … … 59 62 // resultsButton 60 63 // 61 this.resultsButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); 62 this.resultsButton.Location = new System.Drawing.Point(130, 1); 64 this.resultsButton.Location = new System.Drawing.Point(127, 27); 63 65 this.resultsButton.Name = "resultsButton"; 64 66 this.resultsButton.Size = new System.Drawing.Size(86, 23); … … 68 70 this.resultsButton.Click += new System.EventHandler(this.resultsButton_Click); 69 71 // 72 // openButton 73 // 74 this.openButton.Location = new System.Drawing.Point(4, 0); 75 this.openButton.Name = "openButton"; 76 this.openButton.Size = new System.Drawing.Size(75, 23); 77 this.openButton.TabIndex = 8; 78 this.openButton.Text = "Open..."; 79 this.openButton.UseVisualStyleBackColor = true; 80 this.openButton.Click += new System.EventHandler(this.openButton_Click); 81 // 70 82 // ConsoleEditor 71 83 // 72 84 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 85 this.Controls.Add(this.openButton); 73 86 this.Controls.Add(this.viewComboBox); 74 87 this.Controls.Add(this.resultsButton); 75 88 this.Name = "ConsoleEditor"; 76 this.Size = new System.Drawing.Size( 445, 189);89 this.Size = new System.Drawing.Size(224, 112); 77 90 this.ResumeLayout(false); 78 91 … … 94 107 PluginManager.ControlManager.ShowControl(control); 95 108 } 109 110 private void openButton_Click(object sender, EventArgs e) { 111 OpenFileDialog dialog = new OpenFileDialog(); 112 DialogResult result = dialog.ShowDialog(); 113 if (result == DialogResult.OK) { 114 viewComboBox.Enabled = true; 115 resultsButton.Enabled = true; 116 console.Database = dialog.FileName; 117 } 118 } 96 119 } 97 120 }
Note: See TracChangeset
for help on using the changeset viewer.