- Timestamp:
- 04/20/09 15:21:05 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Persistence.GUI/3.3/PersistenceConfigurationForm.cs
r1566 r1611 20 20 private readonly Dictionary<string, Type> typeNameTable; 21 21 private readonly Dictionary<Type, string> reverseTypeNameTable; 22 private bool underConstruction; 22 23 23 24 public PersistenceConfigurationForm() { … … 28 29 typeNameTable = new Dictionary<string, Type>(); 29 30 reverseTypeNameTable = new Dictionary<Type, string>(); 31 underConstruction = true; 32 InitializeTooltips(); 30 33 InitializeNameTables(); 31 34 initializeConfigPages(); 32 35 UpdateFromConfigurationService(); 36 underConstruction = false; 37 UpdatePreview(); 38 } 39 40 private void InitializeTooltips() { 41 ToolTip tooltip = new ToolTip() { 42 AutoPopDelay = 5000, 43 InitialDelay = 1000, 44 ReshowDelay = 500, 45 ShowAlways = true 46 }; 47 tooltip.SetToolTip(resetButton, 48 "Clear all custom configurations from memory.\r\n" + 49 "The saved configuration will still be used next\r\n" + 50 "time if you don't save (define) this change."); 51 tooltip.SetToolTip(updateButton, 52 "Define configuration for currently active format\r\n" + 53 "and save to disk."); 33 54 } 34 55 … … 112 133 Name = "CheckBox", 113 134 Dock = DockStyle.Fill, 114 Enabled = false,115 135 }; 116 136 horizontalSplit.Panel2.Controls.Add(checkBox); … … 246 266 } 247 267 268 private void UpdatePreview() { 269 if (underConstruction) 270 return; 271 ListBox checkBox = (ListBox)GetActiveControl("CheckBox"); 272 IFormat activeFormat = (IFormat)configurationTabs.SelectedTab.Tag; 273 if (activeFormat != null && checkBox != null) { 274 checkBox.Items.Clear(); 275 Configuration activeConfig = GetActiveConfiguration(); 276 foreach (var formatter in activeConfig.Formatters) { 277 checkBox.Items.Add(formatter.GetType().Name + " (F)"); 278 } 279 foreach (var decomposer in activeConfig.Decomposers) 280 checkBox.Items.Add(decomposer.GetType().Name + " (D)"); 281 } 282 } 283 284 248 285 void gridView_CellValueChanged(object sender, DataGridViewCellEventArgs e) { 249 286 UpdatePreview(); … … 292 329 } 293 330 294 private void UpdatePreview() {295 ListBox checkBox = (ListBox)GetActiveControl("CheckBox");296 IFormat activeFormat = (IFormat)configurationTabs.SelectedTab.Tag;297 if (activeFormat != null && checkBox != null) {298 checkBox.Items.Clear();299 Configuration activeConfig = GetActiveConfiguration();300 foreach (var formatter in activeConfig.Formatters) {301 checkBox.Items.Add(formatter.GetType().Name + " (F)");302 }303 foreach (var decomposer in activeConfig.Decomposers)304 checkBox.Items.Add(decomposer.GetType().Name + " (D)");305 }306 }307 331 308 332 private void decomposerList_ItemChecked(object sender, ItemCheckedEventArgs e) { … … 370 394 } 371 395 396 private void resetButton_Click(object sender, EventArgs e) { 397 ConfigurationService.Instance.Reset(); 398 underConstruction = true; 399 UpdateFromConfigurationService(); 400 underConstruction = false; 401 UpdatePreview(); 402 } 403 372 404 } 373 405
Note: See TracChangeset
for help on using the changeset viewer.