implement IDisposable for Document so we can do cool things like (using Document.Load()...)

This commit is contained in:
Michael Becker 2020-05-28 18:19:24 -04:00
parent 477ebaed5a
commit 28bb5da3cc
No known key found for this signature in database
GPG Key ID: 506F54899E2BFED7

View File

@ -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.
/// </summary>
public class Document
public class Document : IDisposable
{
/// <summary>
/// The <see cref="Accessor" /> which determines where the data is read from.
@ -55,6 +55,11 @@ namespace UniversalEditor
/// </summary>
public ObjectModel ObjectModel { get { return mvarObjectModel; } set { mvarObjectModel = value; } }
public void Dispose()
{
Close();
}
/// <summary>
/// Reads data into the current <see cref="ObjectModel" /> from the <see cref="Accessor" /> using the
/// current <see cref="InputDataFormat" />.