public ShapesDocument LoadDocument(string path)
        {
            ShapesDocument document = null;

            using (Stream stream = File.OpenRead(path)) {
                document = formatter.Deserialize(stream) as ShapesDocument;
            }
            return(document);
        }
 public void SaveDocument(ShapesDocument document, string path)
 {
     using (Stream stream = File.OpenWrite(path)) {
         formatter.Serialize(stream, document);
     }
 }