Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11105 for stable


Ignore:
Timestamp:
07/07/14 13:56:57 (10 years ago)
Author:
gkronber
Message:

#2155 merged r10488 from trunk to stable (release)

Location:
stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Optimizer/3.3/StartPage.cs

    r9933 r11105  
    7070    private void LoadSamples(object state) {
    7171      progress = MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(samplesListView, "Loading...");
    72       Assembly assembly = Assembly.GetExecutingAssembly();
    73       var samples = assembly.GetManifestResourceNames().Where(x => x.EndsWith(".hl"));
    74       int count = samples.Count();
    75       string path = Path.GetTempFileName();
     72      try {
     73        Assembly assembly = Assembly.GetExecutingAssembly();
     74        var samples = assembly.GetManifestResourceNames().Where(x => x.EndsWith(".hl"));
     75        int count = samples.Count();
     76        string path = Path.GetTempFileName();
    7677
    77       foreach (string name in samples) {
    78         try {
    79           using (Stream stream = assembly.GetManifestResourceStream(name)) {
    80             WriteStreamToTempFile(stream, path);
    81             INamedItem item = XmlParser.Deserialize<INamedItem>(path);
    82             OnSampleLoaded(item, 1.0 / count);
     78        foreach (string name in samples) {
     79          try {
     80            using (Stream stream = assembly.GetManifestResourceStream(name)) {
     81              WriteStreamToTempFile(stream, path);
     82              INamedItem item = XmlParser.Deserialize<INamedItem>(path);
     83              OnSampleLoaded(item, 1.0 / count);
     84            }
     85          }
     86          catch (Exception) {
    8387          }
    8488        }
    85         catch (Exception) {
    86           MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(samplesListView);
    87         }
     89        OnAllSamplesLoaded();
    8890      }
    89       OnAllSamplesLoaded();
     91      finally {
     92        MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(samplesListView);
     93      }
    9094    }
    9195    private void OnSampleLoaded(INamedItem sample, double progress) {
     
    111115            samplesListView.Columns[i].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
    112116        }
    113         MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(samplesListView);
    114117      }
    115118    }
Note: See TracChangeset for help on using the changeset viewer.