Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8179 for trunk


Ignore:
Timestamp:
07/02/12 15:40:59 (12 years ago)
Author:
gkronber
Message:

#1851: minor code improvements in CreateExperimentDialog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimizer/3.3/CreateExperimentDialog.cs

    r8095 r8179  
    319319          selectAllCheckBox.Checked = treeViewNodes.Count() == instances.SelectMany(x => x.Value).Count();
    320320          selectNoneCheckBox.Checked = !treeViewNodes.Any(x => x.Checked);
    321         }
    322         finally { suppressCheckAllNoneEventHandling = false; }
     321        } finally { suppressCheckAllNoneEventHandling = false; }
    323322        UpdateVariationsLabel();
    324323      }
     
    334333          }
    335334        }
    336       }
    337       finally { suppressTreeViewEventHandling = false; }
     335      } finally { suppressTreeViewEventHandling = false; }
    338336    }
    339337
     
    357355        try {
    358356          node.Parent.Checked = allChecked;
    359         }
    360         finally { suppressTreeViewEventHandling = false; }
     357        } finally { suppressTreeViewEventHandling = false; }
    361358      }
    362359    }
     
    366363        if (selectAllCheckBox.Checked) {
    367364          suppressCheckAllNoneEventHandling = true;
    368           try { selectNoneCheckBox.Checked = false; }
    369           finally { suppressCheckAllNoneEventHandling = false; }
     365          try { selectNoneCheckBox.Checked = false; } finally { suppressCheckAllNoneEventHandling = false; }
    370366          try {
    371367            suppressTreeViewEventHandling = true;
     
    376372              }
    377373            }
    378           }
    379           finally { suppressTreeViewEventHandling = false; }
     374          } finally { suppressTreeViewEventHandling = false; }
    380375        }
    381376        UpdateVariationsLabel();
     
    387382        if (selectNoneCheckBox.Checked) {
    388383          suppressCheckAllNoneEventHandling = true;
    389           try { selectAllCheckBox.Checked = false; }
    390           finally { suppressCheckAllNoneEventHandling = false; }
     384          try { selectAllCheckBox.Checked = false; } finally { suppressCheckAllNoneEventHandling = false; }
    391385          try {
    392386            suppressTreeViewEventHandling = true;
     
    397391              }
    398392            }
    399           }
    400           finally { suppressTreeViewEventHandling = false; }
     393          } finally { suppressTreeViewEventHandling = false; }
    401394        }
    402395        UpdateVariationsLabel();
     
    721714        } catch (OperationCanceledException) {
    722715          e.Cancel = true;
    723           localExperiment = null;
    724716          return;
    725717        }
     
    741733              } catch (OperationCanceledException) {
    742734                e.Cancel = true;
    743                 localExperiment = null;
    744735                return;
    745736              }
     
    748739        }
    749740      }
    750       if (localExperiment != null) {
    751         // this step can take some time
    752         SetMode(DialogMode.PreparingExperiment);
    753         experimentCreationBackgroundWorker.ReportProgress(-1);
    754         localExperiment.Prepare(true);
    755         experimentCreationBackgroundWorker.ReportProgress(100);
    756       }
     741      // this step can take some time
     742      SetMode(DialogMode.PreparingExperiment);
     743      experimentCreationBackgroundWorker.ReportProgress(-1);
     744      localExperiment.Prepare(true);
     745      experimentCreationBackgroundWorker.ReportProgress(100);
    757746      Experiment = localExperiment;
    758747    }
    759748
    760749    private void AddParameterVariations(IOptimizer optimizer, Experiment localExperiment, ref int counter, int totalVariations) {
    761       var variations = experimentCreationBackgroundWorker_CalculateParameterVariations(optimizer);
     750      var variations = CalculateParameterVariations(optimizer);
    762751      foreach (var v in variations) {
    763752        if (experimentCreationBackgroundWorker.CancellationPending)
     
    769758    }
    770759
    771     private IEnumerable<IOptimizer> experimentCreationBackgroundWorker_CalculateParameterVariations(IOptimizer optimizer) {
     760    private IEnumerable<IOptimizer> CalculateParameterVariations(IOptimizer optimizer) {
    772761      if (!boolParameters.Any() && !intParameters.Any() && !doubleParameters.Any() && !multipleChoiceParameters.Any()) {
    773762        var o = (IOptimizer)optimizer.Clone();
     
    885874          Close();
    886875        }
    887       }
    888       catch { }
     876      } catch { }
    889877    }
    890878    #endregion
Note: See TracChangeset for help on using the changeset viewer.