From dfac3d4942688377127d53c35349014e2b9ce953 Mon Sep 17 00:00:00 2001 From: alcexhim Date: Sat, 7 Jun 2014 19:58:50 -0400 Subject: [PATCH] Add ContinueLoading to allow us to switch between DataFormats --- .../Libraries/UniversalEditor.Core/DataFormat.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CSharp/Libraries/UniversalEditor.Core/DataFormat.cs b/CSharp/Libraries/UniversalEditor.Core/DataFormat.cs index 5d8f9285..e824f8d5 100644 --- a/CSharp/Libraries/UniversalEditor.Core/DataFormat.cs +++ b/CSharp/Libraries/UniversalEditor.Core/DataFormat.cs @@ -24,7 +24,19 @@ namespace UniversalEditor } private Accessor mvarAccessor = null; - public Accessor Accessor { get { return mvarAccessor; } set { mvarAccessor = value; } } + protected internal Accessor Accessor { get { return mvarAccessor; } set { mvarAccessor = value; } } + + /// + /// Continues loading the file into the specified with a different + /// . + /// + /// The in which to continue loading the document. + /// The used to parse the document. + protected void ContinueLoading(ref ObjectModel objectModel, DataFormat otherDataFormat) + { + otherDataFormat.Accessor = mvarAccessor; + otherDataFormat.Load(ref objectModel); + } protected virtual bool IsObjectModelSupported(ObjectModel objectModel) {