C

InputModeItemChangedEventArgs<TItem, TDetail>

Event argument that is used by events that indicate deletion or change of an item which is triggered by IInputMode implementations.

Remarks

A specialized subclass of the InputModeItemEventArgs<TModelItem> class that is bound to the IModelItem type and carries detailed context information about the state before the item has been changed or deleted.

If the deleted or changed item was an INode the details property holds a NodeEventArgs instance that provides additional information about the parent node and the group node status of the node before it was deleted or changed.

If the deleted or changed item was an IEdge the details property holds a EdgeEventArgs instance that provides the source and target port information of the edge before it was deleted or changed.

If the deleted item was an IPort the details property holds a PortEventArgs instance that provides the owner of the port before it was deleted.

If the deleted item was an ILabel the details property holds a LabelEventArgs instance that provides the owner of the label before it was deleted.

If the deleted item was an IBend the details property holds a BendEventArgs instance that provides owner and index information of the bend before it was deleted.

Type Parameters

TItem

The type of the changed item.

TDetail

Holder of additional details, see above.

Examples

Processing the details
function OnItemDeleted(
  e: InputModeItemChangedEventArgs<IModelItem, EventArgs>,
) {
  if (e.details instanceof NodeEventArgs) {
    const ne = e.details as NodeEventArgs
    console.log(`Old parent: ${ne.parent}`)
  } else if (e.details instanceof EdgeEventArgs) {
    const ee = e.details as EdgeEventArgs
    console.log(`Old source port owner: ${ee.sourcePortOwner}`)
    console.log(`Old target port owner: ${ee.targetPortOwner}`)
  } else if (e.details instanceof PortEventArgs) {
    const pe = e.details as PortEventArgs
    console.log(`Old port owner: ${pe.owner}`)
  } else if (e.details instanceof LabelEventArgs) {
    const le = e.details as LabelEventArgs
    console.log(`Old label owner: ${le.owner}`)
  } else if (e.details instanceof BendEventArgs) {
    const be = e.details as BendEventArgs
    console.log(`Old bend owner: ${be.owner}`)
  }
}

Members

Show:

Constructors

Initializes a new instance of the InputModeItemChangedEventArgs<TItem, TDetail> class.

Parameters

context: IInputModeContext
The context to initialize the context property with.
item: TItem
The item that has been deleted.
detail: TDetail
Additional information about the state of the item, before it has been deleted.

Properties

Gets the context for the current event.
readonlyfinal

Property Value

The context.
Gets additional information about the state of the item, before it has been deleted.
readonlyfinal

Property Value

Additional information about the state of the item, before it has been deleted.
Gets the item which has been created or changed.
readonlyfinal

Property Value

The affected item.