IModel.Take method

Namespace: NextDesign.Core

Description

Moves the specified model to the specified field of this instance. The parent element of the model to be moved will be this instance. Note that no exception is thrown even if the multiplicity upper limit constraint of the destination field is violated.

argument

Name Type Description
fieldName string Field name
Null or empty string cannot be specified.
target IModel The model to move
null cannot be specified.
direction string Additional direction at the destination
-"first": First
-"last": Last
-"before": Before
-"after": After
index int Additional reference position
Specify the index with 0 as the start position.
When the direction is specified as "first", it moves to the beginning regardless of the index value.
When the direction is specified as "last", it moves to the end regardless of the index value.
If the direction is "before", move the instance to the specified position, and if "after", move the instance to the next position after the specified position.

Return value

  • void

Exception

Name Exception Class Description
Invalid argument ExtensionArgumentException When null is specified for target
fieldName is null or an empty string is specified
When a string other than the default string is specified for direction
Field not found ExtensionFieldNotFoundException If the specified field is not found in this instance's metaclass
Incorrect index range ExtensionOutOfRangeException If a negative number is specified for index
, or if a value greater than the number of elements in the corresponding field is specified for index
Specified field is invalid ExtensionInvalidTypeException If the specified field is not the owning field, or if the data type of the specified field is not compatible with the metaclass of the instance to be moved
Illegal operation ExtensionInvalidOperationException When the model itself is a deleted model or temporary proxy
When an inoperable field is specified in the field name
-Feature assignment field of the product line
-System.Core tag Assigned field
Circular reference ExtensionCircularReferenceException When the invocation target of this method or its ancestor is specified in target
When an invalid model is specified ExtensionInvalidModelException When a deleted model or temporary proxy is specified in the destination model