AlphaFramework API  1.0.3
Protected Member Functions | Protected Attributes | List of all members
AlphaFramework.Editor.UndoCloneTab< T > Class Template Reference

A base class for all editor windows that have undo-functionality based on cloning their whole content More...

Inheritance diagram for AlphaFramework.Editor.UndoCloneTab< T >:
AlphaFramework.Editor.UndoTab< T > AlphaFramework.Editor.Tab

Protected Member Functions

 UndoCloneTab ()
 
override void OnInitialize ()
 Called on startup to load the content for this tab from a file More...
 
override void OnChange ()
 Mark the content of this tab as changed (needs to be saved) and create a new undo-backup More...
 
override void OnUndo ()
 Called to undo the last change More...
 
override void OnRedo ()
 Called to redo the last undone change More...
 
- Protected Member Functions inherited from AlphaFramework.Editor.UndoTab< T >
 UndoTab ()
 
override void OnSaveFile ()
 Called when the content of this tab is to be saved to a file.
 
override void OnChange ()
 Mark the content of this tab as changed (needs to be saved)
 
- Protected Member Functions inherited from AlphaFramework.Editor.Tab
 Tab ()
 
void FocusDefaultControl ()
 Set the focus back to the default control on the tab More...
 
virtual void OnDelete ()
 Hook to delete the currently selected object in this tab More...
 
virtual void OnUpdate ()
 Called on startup, content updates and tab switch to refresh any on-screen displays More...
 
virtual void OnClose ()
 Called when the tab needs to shutdown and close More...
 
void ForceClose ()
 Forces the tab to close, displaying warnings about unsaved data, etc. but not allowing the user to cancel. More...
 

Protected Attributes

Content
 The content to be handled by the undo-system More...
 
- Protected Attributes inherited from AlphaFramework.Editor.UndoTab< T >
readonly Button buttonUndo
 The undo button. More...
 
readonly Button buttonRedo
 The redo button. More...
 
readonly Stack< T > UndoBackups = new Stack<T>()
 Entries used by the undo-system to undo changes More...
 
readonly Stack< T > RedoBackups = new Stack<T>()
 Entries used by the undo-system to redo changes previously undone More...
 
- Protected Attributes inherited from AlphaFramework.Editor.Tab
bool _overwrite
 true if an existing file supposed to be overwritten when SaveFile is called. More...
 
string _fullPath
 The complete (rooted) path to load and/or save the file from/to More...
 
bool Changed
 True when unsaved changes to the content exist More...
 
IToastProvider ToastProvider
 Provides a surface for displaying toast messages to the user. More...
 

Additional Inherited Members

- Public Member Functions inherited from AlphaFramework.Editor.UndoTab< T >
override void Undo ()
 Hook to undo the last change
 
override void Redo ()
 Hook to redo the last undone change
 
- Public Member Functions inherited from AlphaFramework.Editor.Tab
void Open (IToastProvider toastProvider)
 Opens the tab. More...
 
new void Hide ()
 Hides this tab (so that another can be brought to the foreground) More...
 
bool RequestClose ()
 Requests the tab to close, displaying warnings about unsaved data, etc. allowing the user to cancel. More...
 
bool SaveFile ()
 Saves the content of this tab to a file - error-handling included! More...
 
void Delete ()
 Delete the currently selected object in this tab More...
 
- Properties inherited from AlphaFramework.Editor.Tab
string NameUI [get, set]
 The user-friendly name of this editor More...
 
string FilePath [get, protected set]
 The path to the file in this editor More...
 
- Events inherited from AlphaFramework.Editor.Tab
EventHandler TabClosed
 Occurs after the tab was closed More...
 

Detailed Description

A base class for all editor windows that have undo-functionality based on cloning their whole content

Calling OnChange will create an undo checkpoint (_currentBackup) after the fact, ready for the next change. The first checkpoint is created right at startup.

Type Constraints
T :ICloneable<T> 

Member Function Documentation

◆ OnChange()

override void AlphaFramework.Editor.UndoCloneTab< T >.OnChange ( )
inlineprotectedvirtual

Mark the content of this tab as changed (needs to be saved) and create a new undo-backup

Reimplemented from AlphaFramework.Editor.Tab.

◆ OnInitialize()

override void AlphaFramework.Editor.UndoCloneTab< T >.OnInitialize ( )
inlineprotectedvirtual

Called on startup to load the content for this tab from a file

Reimplemented from AlphaFramework.Editor.Tab.

◆ OnRedo()

override void AlphaFramework.Editor.UndoCloneTab< T >.OnRedo ( )
inlineprotectedvirtual

Called to redo the last undone change

Implements AlphaFramework.Editor.UndoTab< T >.

◆ OnUndo()

override void AlphaFramework.Editor.UndoCloneTab< T >.OnUndo ( )
inlineprotectedvirtual

Called to undo the last change

Implements AlphaFramework.Editor.UndoTab< T >.

Member Data Documentation

◆ Content

T AlphaFramework.Editor.UndoCloneTab< T >.Content
protected

The content to be handled by the undo-system


The documentation for this class was generated from the following file: