Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
INodeCommand.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using SiliconStudio.ActionStack;
4 using SiliconStudio.Core.Reflection;
5 
6 namespace SiliconStudio.Quantum.Commands
7 {
8  /// <summary>
9  /// Base interface for node commands.
10  /// </summary>
11  public interface INodeCommand
12  {
13  /// <summary>
14  /// Gets the name of the command.
15  /// </summary>
16  string Name { get; }
17 
18  /// <summary>
19  /// Gets how to combine this command in a combined view model.
20  /// </summary>
22 
23  /// <summary>
24  /// Indicates whether this command can be attached to an object or a member with the given descriptors.
25  /// </summary>
26  /// <param name="typeDescriptor">The <see cref="ITypeDescriptor"/> of the object or the member to attach.</param>
27  /// <param name="memberDescriptor">The <see cref="MemberDescriptorBase"/> of the member to attach. This parameter is <c>null</c> when testing on an object that is not a member of another object.</param>
28  /// <returns></returns>
29  bool CanAttach(ITypeDescriptor typeDescriptor, MemberDescriptorBase memberDescriptor);
30 
31  /// <summary>
32  /// Invokes the node command.
33  /// </summary>
34  /// <param name="currentValue">The current value of the associated object or member.</param>
35  /// <param name="descriptor">The type descriptor of the associated object or member.</param>
36  /// <param name="parameter">The parameter of the command.</param>
37  /// <param name="undoToken">The <see cref="UndoToken"/> that will be passed to the <see cref="Undo"/> method when undoing the execution of this command.</param>
38  /// <returns>The new value to assign to the associated object or member.</returns>
39  object Invoke(object currentValue, ITypeDescriptor descriptor, object parameter, out UndoToken undoToken);
40 
41  /// <summary>
42  /// Undoes an invoke of the node command.
43  /// </summary>
44  /// <param name="currentValue">The current value of the associated object or member.</param>
45  /// <param name="descriptor">The type descriptor of the associated object or member.</param>
46  /// <param name="undoToken">The <see cref="UndoToken"/> that was generated when invoking this command.</param>
47  /// <returns>The new value to assign to the associated object or member.</returns>
48  object Undo(object currentValue, ITypeDescriptor descriptor, UndoToken undoToken);
49  }
50 }
CombineMode
An enum that describes what to do with a node or a command when combining view models.
Definition: CombineMode.cs:8
Base interface for node commands.
Definition: INodeCommand.cs:11
Provides access members of a type.
Base class for IMemberDescriptor for a MemberInfo
Represents a token that stores an unique identifier and an object. This token should be generated by ...
Definition: UndoToken.cs:12