Search Results for

    Show / Hide Table of Contents

    Class SetMemberOperation

    class representing an undoable set member operation.

    Inheritance
    System.Object
    Operation
    SetMemberOperation
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: TimeCockpit.Data.UndoRedo
    Assembly: TimeCockpit.Data.dll
    Syntax
    public class SetMemberOperation : Operation

    Constructors

    SetMemberOperation(String, EntityObject, Object, Object)

    Initializes a new instance of the SetMemberOperation class.

    Declaration
    public SetMemberOperation(string propertyName, EntityObject targetEntity, object previousValue, object currentValue)
    Parameters
    Type Name Description
    System.String propertyName

    the name of the property that changed.

    EntityObject targetEntity

    the entity instance whose property changed.

    System.Object previousValue

    the value the property had before the change.

    System.Object currentValue

    the value the property had after the change.

    Properties

    CurrentValue

    Gets the value the property has now.

    Declaration
    public object CurrentValue { get; }
    Property Value
    Type Description
    System.Object

    PreviousValue

    Gets the value the property had before.

    Declaration
    public object PreviousValue { get; }
    Property Value
    Type Description
    System.Object

    PropertyName

    Gets the name of the property this set member operation applies to.

    Declaration
    public string PropertyName { get; }
    Property Value
    Type Description
    System.String

    TargetEntity

    Gets the instance of the entityobject whose value was changed.

    Declaration
    public EntityObject TargetEntity { get; }
    Property Value
    Type Description
    EntityObject

    Methods

    Redo(ChangeTracker)

    called when the operation is to be re applied.

    Declaration
    public override void Redo(ChangeTracker changeTracker)
    Parameters
    Type Name Description
    ChangeTracker changeTracker

    the change tracker tracking this operation.

    Overrides
    Operation.Redo(ChangeTracker)

    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.

    Declaration
    public override bool TryMerge(Operation newerOperation, ChangeTracker changeTracker)
    Parameters
    Type Name Description
    Operation newerOperation

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

    ChangeTracker changeTracker

    the change tracker governing this operation.

    Returns
    Type Description
    System.Boolean

    Returns true if the newerOperation could be merged to this operation.

    Overrides
    Operation.TryMerge(Operation, ChangeTracker)

    Undo(ChangeTracker)

    called when the operation is to be undone.

    Declaration
    public override void Undo(ChangeTracker changeTracker)
    Parameters
    Type Name Description
    ChangeTracker changeTracker

    the change tracker tracking this operation.

    Overrides
    Operation.Undo(ChangeTracker)
    In This Article
    Back to top Copyright © 2020 software architects gmbh