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 will be thrown even if the upper multiplicity constraint of the destination field is violated.
Arguments
Name | Type | Description |
---|---|---|
fieldName | string | Field name Null or an empty string cannot be specified. |
target | IModel | Model to be moved Null cannot be specified. |
direction | string | Direction of addition at destination - "first" : Beginning - "last" : End - "before" : Before - "after" : After |
index | int | Reference position for addition Specify an index with the first position being 0. If "direction" is specified as "first", it will move to the beginning regardless of the index value. If "direction" is specified as "last", it will move to the end regardless of the index value. If "before" is specified as "direction", the instance will move to the specified position, and if "after", it will move to the position next to the specified position. |
Return value
- void
Exception
Name | Exception class | Description |
---|---|---|
Invalid argument | ExtensionArgumentException | If null is specified for target If null or an empty string is specified for fieldName If a string other than the default string is specified for direction |
Field not found | ExtensionFieldNotFoundException | If the specified field is not found in the metaclass of this instance |
Invalid index range | ExtensionOutOfRangeException | If a negative number is specified for index Or, index is specified as a value greater than the number of elements in the field. |
Invalid specified field | ExtensionInvalidTypeException | The specified field is not an owned field, or the data type of the specified field is not compatible with the metaclass of the instance to be moved. |
Invalid operation | ExtensionInvalidOperationException | If the model itself is a deleted model or a temporary proxy. If an inoperable field is specified for the field name. - Feature assignment field of a product line - Field with the System.Core tag If an invalid field is specified. |
Circular reference | ExtensionCircularReferenceException | If the target for which this method is called or its ancestor is specified for target. |
An invalid model is specified. | ExtensionInvalidModelException | If the following models are specified for the model to be moved. - Deleted model - Temporary proxy - Project - Model that is the base point in the unit and whose parent element has not been loaded. |