Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SiliconStudio.Presentation.Commands.CancellableCommand Class Referenceabstract

A command that supports undo/redo More...

Inheritance diagram for SiliconStudio.Presentation.Commands.CancellableCommand:
SiliconStudio.Presentation.Commands.CommandBase SiliconStudio.Presentation.ViewModel.DispatcherViewModel SiliconStudio.Presentation.Commands.ICommandBase SiliconStudio.Presentation.ViewModel.ViewModelBase INotifyPropertyChanging INotifyPropertyChanged SiliconStudio.Presentation.Quantum.NodeCommandWrapperBase SiliconStudio.Presentation.Quantum.AnonymousCommandWrapper SiliconStudio.Presentation.Quantum.CombinedNodeCommandWrapper SiliconStudio.Presentation.Quantum.ModelNodeCommandWrapper

Public Member Functions

override void Execute (object parameter)
 
void UndoCommand (object parameter, UndoToken token)
 Undoes the execution of this command. More...
 
UndoToken ExecuteCommand (object parameter, bool createActionItem)
 Executes the command and return a token that can be used to undo it. More...
 
- Public Member Functions inherited from SiliconStudio.Presentation.Commands.CommandBase
virtual bool CanExecute (object parameter)
 
bool CanExecute ()
 Invokes CanExecute(object) with a null argument. More...
 
void Execute ()
 Invokes the Execute(object) command with a null argument. More...
 

Protected Member Functions

 CancellableCommand (IViewModelServiceProvider serviceProvider, IEnumerable< IDirtiableViewModel > dirtiables)
 Initializes a new instance of the CancellableCommand class. More...
 
abstract UndoToken Redo (object parameter, bool creatingActionItem)
 Does or redoes the execution of the command. More...
 
abstract void Undo (object parameter, UndoToken token)
 Undoes the execution of the command. More...
 
- Protected Member Functions inherited from SiliconStudio.Presentation.Commands.CommandBase
 CommandBase (IViewModelServiceProvider serviceProvider)
 Initializes a new instance of the CommandBase class. More...
 
- Protected Member Functions inherited from SiliconStudio.Presentation.ViewModel.DispatcherViewModel
 DispatcherViewModel (IViewModelServiceProvider serviceProvider)
 Initializes a new instance of the DispatcherViewModel class. More...
 
override void OnPropertyChanging (params string[] propertyNames)
 This method will raise the PropertyChanging for each of the property name passed as argument.
Parameters
propertyNamesThe names of the properties that is changing.
More...
 
override void OnPropertyChanged (params string[] propertyNames)
 This method will raise the PropertyChanged for each of the property name passed as argument.
Parameters
propertyNamesThe names of the properties that has changed.
More...
 
- Protected Member Functions inherited from SiliconStudio.Presentation.ViewModel.ViewModelBase
 ViewModelBase ()
 
 ViewModelBase (IViewModelServiceProvider serviceProvider)
 
bool SetValue< T > (ref T field, T value, [CallerMemberName]string propertyName=null)
 Sets the value of a field to the given value. Both values are compared with the default EqualityComparer{T}, and if they are equals, this method does nothing. If they are different, the PropertyChanging event will be raised first, then the field value will be modified, and finally the PropertyChanged event will be raised. More...
 
bool SetValue< T > (ref T field, T value, params string[] propertyNames)
 Sets the value of a field to the given value. Both values are compared with the default EqualityComparer{T}, and if they are equals, this method does nothing. If they are different, the PropertyChanging will be raised first, then the field value will be modified, and finally the PropertyChanged event will be raised. More...
 
bool SetValue< T > (ref T field, T value, Action updateAction, [CallerMemberName]string propertyName=null)
 Sets the value of a field to the given value. Both values are compared with the default EqualityComparer{T}, and if they are equals, this method does nothing. If they are different, the PropertyChanging event will be raised first, then the field value will be modified. The given update action will be executed and finally the PropertyChanged event will be raised. More...
 
virtual bool SetValue< T > (ref T field, T value, Action updateAction, params string[] propertyNames)
 Sets the value of a field to the given value. Both values are compared with the default EqualityComparer{T}, and if they are equals, this method does nothing. If they are different, the PropertyChanging event will be raised first, then the field value will be modified. The given update action will be executed and finally the PropertyChanged event will be raised. More...
 
bool SetValue (Action updateAction, [CallerMemberName]string propertyName=null)
 Manages a property modification and its notifications. This method will invoke the provided update action. The PropertyChanging event will be raised prior to the update action, and the PropertyChanged event will be raised after. More...
 
bool SetValue (Action updateAction, params string[] propertyNames)
 Manages a property modification and its notifications. This method will invoke the provided update action. The PropertyChanging event will be raised prior to the update action, and the PropertyChanged event will be raised after. More...
 
bool SetValue (Func< bool > hasChangedFunction, Action updateAction, [CallerMemberName]string propertyName=null)
 Manages a property modification and its notifications. A function is provided to check whether the new value is different from the current one. This function will be invoked by this method, and if it returns True, it will invoke the provided update action. The PropertyChanging event will be raised prior to the update action, and the PropertyChanged event will be raised after. More...
 
bool SetValue (bool hasChanged, Action updateAction, [CallerMemberName]string propertyName=null)
 Manages a property modification and its notifications. The first parameter hasChanged should indicate whether the property should actuallybe updated. If this parameter is True, it will invoke the provided update action. The PropertyChanging event will be raised prior to the update action, and the PropertyChanged event will be raised after. More...
 
bool SetValue (bool hasChanged, Action updateAction, params string[] propertyNames)
 Manages a property modification and its notifications. The first parameter hasChanged should indicate whether the property should actuallybe updated. If this parameter is True, it will invoke the provided update action. The PropertyChanging event will be raised prior to the update action, and the PropertyChanged event will be raised after. More...
 
virtual bool SetValue (Func< bool > hasChangedFunction, Action updateAction, params string[] propertyNames)
 Manages a property modification and its notifications. A function is provided to check whether the new value is different from the current one. This function will be invoked by this method, and if it returns True, it will invoke the provided update action. The PropertyChanging event will be raised prior to the update action, and the PropertyChanged event will be raised after. More...
 

Properties

abstract string Name [get]
 The name of this command. More...
 
- Properties inherited from SiliconStudio.Presentation.Commands.CommandBase
bool IsEnabled [get, set]
 
- Properties inherited from SiliconStudio.Presentation.ViewModel.DispatcherViewModel
IDispatcherService Dispatcher [get, set]
 Gets a dispatcher that is capable of executing code in the UI thread. More...
 
- Properties inherited from SiliconStudio.Presentation.Commands.ICommandBase
bool IsEnabled [get, set]
 Indicates whether the command can be executed or not. More...
 

Additional Inherited Members

- Public Attributes inherited from SiliconStudio.Presentation.ViewModel.ViewModelBase
IViewModelServiceProvider ServiceProvider = ViewModelServiceProvider.NullServiceProvider
 An IViewModelServiceProvider that allows to retrieve various service objects. More...
 
- Protected Attributes inherited from SiliconStudio.Presentation.ViewModel.ViewModelBase
List< Tuple< string, string > > DependentProperties = new List<Tuple<string, string>>()
 A list of couple of property names that are dependent. For each couple of this list, if the first property name is notified as being changed, then the second property name will also be notified has being changed. More...
 
- Events inherited from SiliconStudio.Presentation.Commands.CommandBase
EventHandler CanExecuteChanged
 
- Events inherited from SiliconStudio.Presentation.ViewModel.ViewModelBase
PropertyChangingEventHandler PropertyChanging
 
PropertyChangedEventHandler PropertyChanged
 

Detailed Description

A command that supports undo/redo

Definition at line 13 of file CancellableCommand.cs.

Constructor & Destructor Documentation

SiliconStudio.Presentation.Commands.CancellableCommand.CancellableCommand ( IViewModelServiceProvider  serviceProvider,
IEnumerable< IDirtiableViewModel dirtiables 
)
protected

Initializes a new instance of the CancellableCommand class.

Parameters
serviceProviderA service provider that can provide a IActionStack to use for this view model.
dirtiablesThe IDirtiableViewModel instances associated to this command.

Definition at line 23 of file CancellableCommand.cs.

Member Function Documentation

override void SiliconStudio.Presentation.Commands.CancellableCommand.Execute ( object  parameter)
virtual
UndoToken SiliconStudio.Presentation.Commands.CancellableCommand.ExecuteCommand ( object  parameter,
bool  createActionItem 
)

Executes the command and return a token that can be used to undo it.

Parameters
parameterThe command parameter.
createActionItemIndicates whether to create an action item in the action stack. This should be false in case of a Redo operation.
Returns
An UndoToken that can be used to undo the command.

Definition at line 57 of file CancellableCommand.cs.

abstract UndoToken SiliconStudio.Presentation.Commands.CancellableCommand.Redo ( object  parameter,
bool  creatingActionItem 
)
protectedpure virtual

Does or redoes the execution of the command.

Parameters
parameterThe command parameter.
creatingActionItemIndicates whether an action item is being created for the action stack
Returns
An UndoToken that can be used to undo the command.

Implemented in SiliconStudio.Presentation.Quantum.AnonymousCommandWrapper, SiliconStudio.Presentation.Quantum.CombinedNodeCommandWrapper, and SiliconStudio.Presentation.Quantum.ModelNodeCommandWrapper.

abstract void SiliconStudio.Presentation.Commands.CancellableCommand.Undo ( object  parameter,
UndoToken  token 
)
protectedpure virtual

Undoes the execution of the command.

Parameters
parameterThe command parameter.
tokenThe UndoToken generated by the execution of this command.

Implemented in SiliconStudio.Presentation.Quantum.CombinedNodeCommandWrapper, SiliconStudio.Presentation.Quantum.AnonymousCommandWrapper, and SiliconStudio.Presentation.Quantum.ModelNodeCommandWrapper.

void SiliconStudio.Presentation.Commands.CancellableCommand.UndoCommand ( object  parameter,
UndoToken  token 
)

Undoes the execution of this command.

Parameters
parameterThe parameter used to invoke the command.
tokenThe UndoToken generated by the execution of this command.

Definition at line 46 of file CancellableCommand.cs.

Property Documentation

abstract string SiliconStudio.Presentation.Commands.CancellableCommand.Name
get

The name of this command.

Definition at line 33 of file CancellableCommand.cs.


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