private void OpenPresentation(string path) { using (var stream = new FileStream(path, FileMode.Open, FileAccess.Read)) { using (var reader = new BinaryPresentationReader(stream)) { Model.Presentation = reader.Read(); } } }
private static IGraphPresentation SerializeDeserialize(IGraphPresentation presentation) { using (var stream = new MemoryStream()) { using (var writer = new BinaryPresentationWriter(stream)) { writer.Write(presentation); } stream.Seek(0, SeekOrigin.Begin); using (var reader = new BinaryPresentationReader(stream)) { return(reader.Read()); } } }