Table of Contents

Class SetMemberOperation

Namespace
TimeCockpit.Data.UndoRedo
Assembly
TimeCockpit.Data.dll

class representing an undoable set member operation.

public class SetMemberOperation : Operation
Inheritance
Object
SetMemberOperation
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

propertyName String

the name of the property that changed.

targetEntity EntityObject

the entity instance whose property changed.

previousValue Object

the value the property had before the change.

currentValue Object

the 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

EntityObject

Methods

Redo(ChangeTracker)

called when the operation is to be re applied.

public override void Redo(ChangeTracker changeTracker)

Parameters

changeTracker ChangeTracker

the 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

newerOperation Operation

the newer operation that should possibly be merged with this operation.

changeTracker ChangeTracker

the 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

changeTracker ChangeTracker

the change tracker tracking this operation.