Class SetMemberOperation
- Namespace
- TimeCockpit.Data.UndoRedo
- Assembly
- TimeCockpit.Data.dll
class representing an undoable set member operation.
public class SetMemberOperation : Operation
- Inheritance
-
ObjectSetMemberOperation
- Inherited Members
-
Object.ToString()Object.Equals(Object)Object.Equals(Object, Object)Object.ReferenceEquals(Object, Object)Object.GetHashCode()Object.GetType()Object.MemberwiseClone()
Constructors
SetMemberOperation(String, EntityObject, Object, Object)
Initializes a new instance of the SetMemberOperation class.
public SetMemberOperation(string propertyName, EntityObject targetEntity, object previousValue, object currentValue)
Parameters
propertyNameStringthe name of the property that changed.
targetEntityEntityObjectthe entity instance whose property changed.
previousValueObjectthe value the property had before the change.
currentValueObjectthe value the property had after the change.
Properties
CurrentValue
Gets the value the property has now.
public object CurrentValue { get; }
Property Value
- Object
PreviousValue
Gets the value the property had before.
public object PreviousValue { get; }
Property Value
- Object
PropertyName
Gets the name of the property this set member operation applies to.
public string PropertyName { get; }
Property Value
- String
TargetEntity
Gets the instance of the entityobject whose value was changed.
public EntityObject TargetEntity { get; }
Property Value
Methods
Redo(ChangeTracker)
called when the operation is to be re applied.
public override void Redo(ChangeTracker changeTracker)
Parameters
changeTrackerChangeTrackerthe change tracker tracking this operation.
TryMerge(Operation, ChangeTracker)
checks whether the newer operation is also a set member operation targeting the same property of the same entity object. if so, the CurrentValue property is updated to the CurrentValue of the newerOperation and true is returned, indicating that the newer operation can be discarded.
public override bool TryMerge(Operation newerOperation, ChangeTracker changeTracker)
Parameters
newerOperationOperationthe newer operation that should possibly be merged with this operation.
changeTrackerChangeTrackerthe change tracker governing this operation.
Returns
- Boolean
Returns true if the newerOperation could be merged to this operation.
Undo(ChangeTracker)
called when the operation is to be undone.
public override void Undo(ChangeTracker changeTracker)
Parameters
changeTrackerChangeTrackerthe change tracker tracking this operation.