Skip to main content

IModelCopyService Interface

Namespace: NextDesign.Core.Runtime

Description

Model copy service.
Provides model copy and paste operations.

Method

NameDescription
CanCopy(IProject,IEnumerable<IModel>)Checks whether all specified models can be copied in the specified project. It is determined that copying is possible if all specified models are managed by the specified project.
CanCopy(IProject,IModel)Checks whether the specified model can be copied in the specified project. It is determined that copying is possible if the specified model is managed by the specified project.
CanPasteChecks whether a copied model in the specified project can be pasted to the specified model location.
If the following conditions are met, it determines that pasting is not possible and returns false.
- The specified base model for the paste destination does not exist in the specified project.
- The metamodel structure of the base model for the paste destination does not allow pasting (for example, the corresponding class type field does not exist).
Copy(IProject,IEnumerable<IModel>)Copies all specified models in the specified project. The copied models are managed by ICopyContext and can be pasted as child elements (or sibling elements) of any model using Paste(). All child elements of all specified models as bases, as well as the relationships between those models, are copied.
Copy(IProject,IModel)Copies the specified models in the specified project. Copied models are managed by ICopyContext and can be pasted as child elements (or sibling elements) of any other model using Paste(). All child elements starting from the specified model and the relationships between those models are copied.
PastePastes a copied model in the specified project to the specified model location.
Pasting to another project is also possible.