IModel.Take method
Namespace: NextDesign.Core
Description
Moves the specified model to the specified field of this instance.
This instance is the parent element of the model to be moved.
Note that no exception is thrown even if the upper multiplicity constraint of the destination field is violated.
argument
Name | Type | Description |
---|---|---|
fieldName | string | Field name You cannot specify null or an empty string. |
target | IModel | Model to move Cannot be null. |
direction | string | Additional direction at destination - "first" : beginning - "last" : end - "before" : before - "after" : after |
index | int | Additional reference position Specifies the index with 0 as the starting position. If the direction specification is "first", it moves to the beginning regardless of the index value. If the specified direction is "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 it is "after", move the instance to the next position after the specified position. |
Return value
- void
Exceptions
Name | Exception Class | Description |
---|---|---|
Invalid argument | ExtensionArgumentException | When null is specified for target When null or an empty string is specified for fieldName 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 |
Invalid index range | ExtensionOutOfRangeException | When a negative number is specified for index or when 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 incompatible with the metaclass of the instance to be moved |
Illegal operation | ExtensionInvalidOperationException | If the model itself has been deleted or is a temporary proxy If an inoperable field is specified in the field name - Product line feature assignment field - System Fields tagged with .Core |
Circular reference | ExtensionCircularReferenceException | If target specifies itself or an ancestor of this method call |
Specifying an invalid model | ExtensionInvalidModelException | If the following model is specified for the model to be moved - Deleted model - Temporary proxy - Project - Unit A model that is the base point in and whose parent element has not been loaded |