Changeset 3038 for trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/IO/Binary/BinarySerializer.cs
- Timestamp:
- 03/15/10 14:53:49 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/IO/Binary/BinarySerializer.cs
r2768 r3038 27 27 FileStream fs = new FileStream(fileName, FileMode.Create); 28 28 29 GenericFormatter<BinaryFormatter> f = new GenericFormatter<BinaryFormatter>(); 30 31 try 32 { 33 Document document = control.Document; 34 29 GenericFormatter<BinaryFormatter> f = new GenericFormatter<BinaryFormatter>(); 35 30 36 //Warning!: cleaning up, you need to unhook all events since 37 // unserializable classes hooked to events will give problems. 38 f.Serialize<Document>(fs, document ); 39 return true; 40 } 41 catch(Exception exc) 42 { 43 //site.OutputInfo("The graph was not saved, because some graph events were attached to non-serializable classes.\r\n This is a known issue and will be resolved in a later stadium.",OutputInfoLevels.Exception); 44 Trace.WriteLine(exc.Message, "BinarySerializer.SaveAs"); 45 46 //DumpInfo(); 47 } 48 catch 49 { 50 Trace.WriteLine("Non-CLS exception caught.","BinarySerializer.SaveAs"); 51 } 31 try { 32 Document document = control.Document; 33 34 35 //Warning!: cleaning up, you need to unhook all events since 36 // unserializable classes hooked to events will give problems. 37 f.Serialize<Document>(fs, document); 38 return true; 39 } 40 catch (Exception exc) { 41 //site.OutputInfo("The graph was not saved, because some graph events were attached to non-serializable classes.\r\n This is a known issue and will be resolved in a later stadium.",OutputInfoLevels.Exception); 42 Trace.WriteLine(exc.Message, "BinarySerializer.SaveAs"); 43 44 //DumpInfo(); 45 } 52 46 finally 53 47 { … … 117 111 MessageBox.Show(exc.Message, "BinarySerializer.Open"); 118 112 } 119 catch120 {121 MessageBox.Show("Non-CLS exception caught.", "BinarySerializer.Open");122 123 }124 113 finally 125 114 {
Note: See TracChangeset
for help on using the changeset viewer.