ModelChangedEventArgs
This class represents a change to a model.
Inherits: PropertyChangedEventArgs
Implements: IUndoableEdit
Constructors
public ModelChangedEventArgs()
modelChangedEventArgs = ModelChangedEventArgs()
The empty/default constructor produces an EventArgs whose properties still need to be initialized.
public ModelChangedEventArgs(string pname, object data, object oldval, object newval)
modelChangedEventArgs = ModelChangedEventArgs(pname, data, oldval, newval)
This constructor initializes the mostly commonly used properties.
- pname
- the PropertyName property
- data
- the Data property
- oldval
- the OldValue property
- newval
- the NewValue property
public ModelChangedEventArgs(ModelChangedEventArgs e)
modelChangedEventArgs = ModelChangedEventArgs(e)
This is basically a "copy constructor", making a copy of the given ModelChangedEventArgs.
- e
Properties
public ModelChange Change { get; set; }
value = modelChangedEventArgs.Change
modelChangedEventArgs.Change = value
Gets or sets the kind of change that this represents.
public object Data { get; set; }
value = modelChangedEventArgs.Data
modelChangedEventArgs.Data = value
Gets or sets the data object, part of the model, that was modified.
public IDiagramModel Model { get; set; }
value = modelChangedEventArgs.Model
modelChangedEventArgs.Model = value
Gets or sets the IDiagramModel that has been modified.
public object NewParam { get; set; }
value = modelChangedEventArgs.NewParam
modelChangedEventArgs.NewParam = value
Gets or sets an optional value associated with the new value.
public object NewValue { get; set; }
value = modelChangedEventArgs.NewValue
modelChangedEventArgs.NewValue = value
Gets or sets the next or current value that the property has.
public object OldParam { get; set; }
value = modelChangedEventArgs.OldParam
modelChangedEventArgs.OldParam = value
Gets or sets an optional value associated with the old value.
public object OldValue { get; set; }
value = modelChangedEventArgs.OldValue
modelChangedEventArgs.OldValue = value
Gets or sets the previous or old value that the property had.
Methods
public bool CanRedo()
result = modelChangedEventArgs.CanRedo()
This predicate returns true if you can call Redo.
public bool CanUndo()
result = modelChangedEventArgs.CanUndo()
This predicate returns true if you can call Undo.
public void Clear()
modelChangedEventArgs.Clear()
Forget any references that this object may have.
public object GetParam(bool undo)
result = modelChangedEventArgs.GetParam(undo)
This is a convenient method to get the right parameter value, depending on the value of .
- undo
Returns: either OldParam or NewParam
public object GetValue(bool undo)
result = modelChangedEventArgs.GetValue(undo)
This is a convenient method to get the right value, depending on the value of .
- undo
Returns: either OldValue or NewValue
public void Redo()
modelChangedEventArgs.Redo()
Re-perform the document change after an Undo by calling Boolean).
public override string ToString()
result = modelChangedEventArgs.ToString()
Produce a human-readable description of the change to the model.
public void Undo()
modelChangedEventArgs.Undo()
Reverse the effects of this document change by calling Boolean).