Changeset 17251 for branches/2521_ProblemRefactoring/HeuristicLab.Optimizer
- Timestamp:
- 09/13/19 11:37:59 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Optimizer/3.3/StartPage.cs
r17241 r17251 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Drawing; 24 25 using System.IO; 25 26 using System.Linq; … … 110 111 } 111 112 112 } catch {113 113 } finally { 114 114 OnAllSamplesLoaded(); … … 120 120 using (var stream = assembly.GetManifestResourceStream(name)) { 121 121 var serializer = new ProtoBufSerializer(); 122 var item = (NamedItem)serializer.Deserialize(stream, false); 122 NamedItem item; 123 try { 124 item = (NamedItem)serializer.Deserialize(stream, false); 125 } catch { 126 item = new ErrorMessage(name, "Sample failed to load!"); 127 } 123 128 OnSampleLoaded(item, group, 1.0 / count); 124 129 } … … 197 202 Properties.Settings.Default.Save(); 198 203 } 204 205 [Item("Error Message", "")] 206 class ErrorMessage : NamedItem { 207 public override Image ItemImage => Common.Resources.VSImageLibrary.Error; 208 209 protected ErrorMessage(ErrorMessage original, Cloner cloner) : base(original, cloner) { } 210 public ErrorMessage(string error, string description) : base(error, description) { } 211 212 public override IDeepCloneable Clone(Cloner cloner) { 213 return new ErrorMessage(this, cloner); 214 } 215 } 199 216 } 200 217 }
Note: See TracChangeset
for help on using the changeset viewer.