private void SavePresentation(string path) { using (var stream = new FileStream(path, FileMode.Create, FileAccess.Write)) { using (var writer = new BinaryPresentationWriter(stream)) { writer.Write(Model.Presentation); } } }
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()); } } }