- CInputModeItemEventArgs<TItem>
- CInputModeItemChangedEventArgs<TItem, TDetail>
Remarks
This specialized subclass of the InputModeItemEventArgs<TModelItem> class provides detailed context information about the state before the InputModeItemEventArgs.item<TModelItem> was modified.
If the item is an INode, the details<TItem, TDetail> property holds a NodeEventArgs instance that provides additional information about the parent node and the group node status of the node before the modification.
If the item is an IEdge, the details<TItem, TDetail> property holds a EdgeEventArgs instance that provides the source and target port information of the edge before the modification.
If the item is an IPort, the details<TItem, TDetail> property holds a PortEventArgs instance that provides the owner of the port before the modification.
If the item is an ILabel, the details<TItem, TDetail> property holds a LabelEventArgs instance that provides the owner of the label before the modification.
If the item is an IBend, the details<TItem, TDetail> property holds a BendEventArgs instance that provides owner and index information of the bend before the modification.
Type Parameters
TItem
: IModelItem- The type of the changed item.
TDetail
: EventArgs- Holder of additional details, see above.
Examples
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
Constructors
Initializes a new instance of the InputModeItemChangedEventArgs<TItem, TDetail> class.
Parameters
- context: IInputModeContext
- The context to initialize the InputModeEventArgs.context property with.
- item: TItem
- The item that is affected.
- detail: TDetail
- Additional information about the element's state prior to the modification.