Skip to main content

IModelDuplicateService.CanDuplicate Method

Namespace: NextDesign.Core.Runtime

Description

Checks whether the specified model can be duplicated in the specified project.
If any of the following conditions are met, the function returns false, indicating that duplication is not possible.

  • The specified model is not managed by the specified project.
  • The specified model is related.
  • The specified model does not have a parent element (or the parent element has not been loaded).
  • Duplication would result in a multiplicity violation in the parent element of the specified model.

Argument

NameTypeDescription
projectIProjectProject
modelIModelModel to be duplicated

Return value

  • bool

Exception

NameException classDescription
Invalid argumentExtensionArgumentExceptionIf null is specified for project
If null is specified for model
Invalid operationExtensionInvalidOperationExceptionIf project is a closed project. is specified
Not supportedExtensionNotSupportedExceptionIf the current edition of the application is not compatible