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
TUniverse
The 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
getUniverse
Func<TUniverse>Called to get the current
TUniverse
in the editor.setUniverse
Action<TUniverse>Called to change the current
TUniverse
in the editor.xmlData
stringThe XML string to parse.
refreshHandler
ActionCalled 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
oldUniverse
TUniversenewUniverse
TUniverse