コード例 #1
0
        public ShapesDocument LoadDocument(string path)
        {
            ShapesDocument document = null;

            using (Stream stream = File.OpenRead(path)) {
                document = formatter.Deserialize(stream) as ShapesDocument;
            }
            return(document);
        }
コード例 #2
0
 public void SaveDocument(ShapesDocument document, string path)
 {
     using (Stream stream = File.OpenWrite(path)) {
         formatter.Serialize(stream, document);
     }
 }