Skip to main content

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

NameTypeDescription
newOwnerIModelDestination (new parent model)
Null cannot be specified.
fieldNamestringField name
Null or an empty string cannot be specified.
directionstringAddition direction at the destination
-"first": First
-"last": Last
-"before": Before
-"after": After
indexintAdditional 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

NameException ClassDescription
Invalid argumentExtensionArgumentExceptionWhen 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 foundExtensionFieldNotFoundExceptionIf the specified field is not found in the metaclass of the destination instance
Invalid index rangeExtensionOutOfRangeExceptionWhen 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 invalidExtensionInvalidTypeExceptionThe specified field is not a owned field, or the data type of the specified field is incompatible with the metaclass of this instance
Illegal operationExtensionInvalidOperationExceptionIf 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 referenceExtensionCircularReferenceExceptionWhen newOwner is the target of this method or its descendants
Invalid model specifiedExtensionInvalidModelExceptionWhen 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