Class ImportXmlBase<TUniverse>
- Namespace
- AlphaFramework.Editor.World.Commands
- Assembly
- AlphaFramework.Editor.dll
Common base for loading new XML data into a IUniverse.
public abstract class ImportXmlBase<TUniverse> : FirstExecuteCommand, IUndoCommand where TUniverse : class, IUniverse
Type Parameters
TUniverseThe specific type of IUniverse to load XML data for.
- Inheritance
-
ImportXmlBase<TUniverse>
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
ImportXmlBase(Func<TUniverse>, Action<TUniverse>, string, Action)
Creates a new command for loading XML data into a TUniverse.
protected ImportXmlBase(Func<TUniverse> getUniverse, Action<TUniverse> setUniverse, string xmlData, Action refreshHandler)
Parameters
getUniverseFunc<TUniverse>Called to get the current
TUniversein the editor.setUniverseAction<TUniverse>Called to change the current
TUniversein the editor.xmlDatastringThe XML string to parse.
refreshHandlerActionCalled when the presenter needs to be reset.
Methods
OnFirstExecute()
Imports the XML data
protected override void OnFirstExecute()
OnRedo()
Restores the imported XML data
protected override void OnRedo()
OnUndo()
Restores the original XML data
protected override void OnUndo()
TransferNonXmlData(TUniverse, TUniverse)
Transfers any non-serialized data from oldUniverse to newUniverse.
protected abstract void TransferNonXmlData(TUniverse oldUniverse, TUniverse newUniverse)
Parameters
oldUniverseTUniversenewUniverseTUniverse