Exemple #1
0
 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();
         }
     }
 }
Exemple #2
0
        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());
                }
            }
        }