4 using System.Reflection;
6 namespace SiliconStudio.ActionStack
10 private readonly
string propertyName;
11 private object container;
12 private object previousValue;
16 if (propertyName == null)
throw new ArgumentNullException(
"propertyName");
17 if (container == null)
throw new ArgumentNullException(
"container");
18 this.propertyName = propertyName;
19 this.container = container;
20 this.previousValue = previousValue;
26 public string PropertyName {
get {
return propertyName; } }
38 PropertyInfo propertyInfo = container.GetType().GetProperty(propertyName, BindingFlags.Public | BindingFlags.Instance);
39 object value = previousValue;
40 previousValue = propertyInfo.GetValue(container);
41 propertyInfo.SetValue(container, value);
PropertyChangedActionItem(string propertyName, object container, object previousValue)
Base class for action items.
override void UndoAction()
Invoked by Undo after setting IsDone to true.
override void FreezeMembers()
Invoked by Freeze before setting IsFrozen to true. This method will not be invoked if IsFrozen is alr...
override void RedoAction()
Invoked by Redo after setting IsDone to true.