Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/10/12 18:26:30 (13 years ago)
Author:
gkronber
Message:

#1851: fixed cross-thread exception related to the backgroundworker for creating experiments.

File:
1 edited

Legend:

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

    r7974 r7975  
    284284          selectAllCheckBox.Checked = treeViewNodes.Count() == instances.SelectMany(x => x.Value).Count();
    285285          selectNoneCheckBox.Checked = !treeViewNodes.Any(x => x.Checked);
    286         } finally { suppressCheckAllNoneEventHandling = false; }
     286        }
     287        finally { suppressCheckAllNoneEventHandling = false; }
    287288        UpdateVariationsLabel();
    288289      }
     
    298299          }
    299300        }
    300       } finally { suppressTreeViewEventHandling = false; }
     301      }
     302      finally { suppressTreeViewEventHandling = false; }
    301303    }
    302304
     
    320322        try {
    321323          node.Parent.Checked = allChecked;
    322         } finally { suppressTreeViewEventHandling = false; }
     324        }
     325        finally { suppressTreeViewEventHandling = false; }
    323326      }
    324327    }
     
    328331        if (selectAllCheckBox.Checked) {
    329332          suppressCheckAllNoneEventHandling = true;
    330           try { selectNoneCheckBox.Checked = false; } finally { suppressCheckAllNoneEventHandling = false; }
     333          try { selectNoneCheckBox.Checked = false; }
     334          finally { suppressCheckAllNoneEventHandling = false; }
    331335          try {
    332336            suppressTreeViewEventHandling = true;
     
    337341              }
    338342            }
    339           } finally { suppressTreeViewEventHandling = false; }
     343          }
     344          finally { suppressTreeViewEventHandling = false; }
    340345        }
    341346      }
     
    346351        if (selectNoneCheckBox.Checked) {
    347352          suppressCheckAllNoneEventHandling = true;
    348           try { selectAllCheckBox.Checked = false; } finally { suppressCheckAllNoneEventHandling = false; }
     353          try { selectAllCheckBox.Checked = false; }
     354          finally { suppressCheckAllNoneEventHandling = false; }
    349355          try {
    350356            suppressTreeViewEventHandling = true;
     
    355361              }
    356362            }
    357           } finally { suppressTreeViewEventHandling = false; }
     363          }
     364          finally { suppressTreeViewEventHandling = false; }
    358365        }
    359366      }
     
    677684          node.Collapse();
    678685        selectNoneCheckBox.Checked = true;
    679       } catch { }
     686      }
     687      catch { }
    680688      try {
    681689        SetMode(DialogMode.Normal);
    682690        if (e.Error != null) MessageBox.Show(e.Error.Message, "Error occurred", MessageBoxButtons.OK, MessageBoxIcon.Error);
    683       } catch { }
     691      }
     692      catch { }
    684693    }
    685694    #endregion
     
    710719            try {
    711720              ProblemInstanceManager.LoadData(provider, descriptor, (IProblemInstanceConsumer)algorithm.Problem);
    712             } catch (Exception ex) {
     721            }
     722            catch (Exception ex) {
    713723              failedInstances.AppendLine(descriptor.Name + ": " + ex.Message);
    714724              failed = true;
     
    721731      }
    722732      if (localExperiment != null) {
     733        // don't do GUI stuff in do_work
    723734        // this step can take some time
    724         SetMode(DialogMode.PreparingExperiment);
    725735        experimentCreationBackgroundWorker.ReportProgress(-1);
    726736        localExperiment.Prepare(true);
     
    833843        experimentCreationProgressBar.Value = e.ProgressPercentage;
    834844      } else {
     845        SetMode(DialogMode.PreparingExperiment);
     846
    835847        experimentCreationProgressBar.Style = ProgressBarStyle.Marquee;
    836848      }
     
    847859          Close();
    848860        }
    849       } catch { }
     861      }
     862      catch { }
    850863    }
    851864    #endregion
Note: See TracChangeset for help on using the changeset viewer.