From 28bb5da3cc80313426cdd25abd8252455eb60a4d Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Thu, 28 May 2020 18:19:24 -0400 Subject: [PATCH] implement IDisposable for Document so we can do cool things like (using Document.Load()...) --- Libraries/UniversalEditor.Core/Document.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Libraries/UniversalEditor.Core/Document.cs b/Libraries/UniversalEditor.Core/Document.cs index ba2845f2..5c2237e9 100644 --- a/Libraries/UniversalEditor.Core/Document.cs +++ b/Libraries/UniversalEditor.Core/Document.cs @@ -30,7 +30,7 @@ namespace UniversalEditor /// to, the DataFormat determines HOW the data is written, and the ObjectModel contains the actual data in a format- /// agnostic representation. /// - public class Document + public class Document : IDisposable { /// /// The which determines where the data is read from. @@ -55,6 +55,11 @@ namespace UniversalEditor /// public ObjectModel ObjectModel { get { return mvarObjectModel; } set { mvarObjectModel = value; } } + public void Dispose() + { + Close(); + } + /// /// Reads data into the current from the using the /// current .