IModel.MoveTo method
Namespace: NextDesign.Core
Description
Move this instance to be a child element of the specified model. If the destination parent element and field are the same as the current parent element and field, change the order of the elements in the specified field. Note that no exception is thrown if the destination field's multiplicity upper bound constraint is violated.
argument
Name | Type | Description |
---|---|---|
newOwner | IModel | Destination (new parent model) Null cannot be specified. |
fieldName | string | Field name Null or an empty string cannot be specified. |
direction | string | Addition direction at the destination -"first": First -"last": Last -"before": Before -"after": After |
index | int | Additional reference position Specify the index with the start position as 0. If the direction is specified as "first", it will move to the beginning regardless of the index value. If the direction is specified as "last", it will be moved to the end regardless of the index value. If the direction specification is "before", the instance is moved to the specified position, and if it is "after", the instance is moved to the position next to the specified position. |
Return value
- void
Exception
Name | Exception Class | Description |
---|---|---|
Invalid argument | ExtensionArgumentException | When null is specified for newOwner When null or an empty string is specified for fieldName When a character string other than the default character string is specified for direction |
Field not found | ExtensionFieldNotFoundException | If the specified field is not found in the metaclass of the destination instance |
Invalid index range | ExtensionOutOfRangeException | When a negative number is specified for index , or when a value greater than or equal to the number of elements in the corresponding field of the destination is specified for index |
Specified field invalid | ExtensionInvalidTypeException | The specified field is not a owned field, or the data type of the specified field is incompatible with the metaclass of this instance |
Illegal operation | ExtensionInvalidOperationException | If it is a deleted model or a temporary proxy If an inoperable field is specified in the field name -Product line feature assignment field -System Fields with .Core tags |
Circular reference | ExtensionCircularReferenceException | When newOwner is the target of this method or its descendants |
Invalid model specified | ExtensionInvalidModelException | When the deleted model or temporary proxy is specified for the destination model It is the base point in the project or unit, and the parent element is not loaded. For models |