IProject.AddNewRootModel(IPackage,string,bool) Method
Namespace: NextDesign.Core
Description
Adds a new model of the specified class to the project.
The specified class is identified from the package specified in the scope.
Even if the specified class is an abstract class, instantiation is allowed and it is added as the last element of the corresponding field.
The added model is stored as an element under the project node (directly under the project) displayed on the model navigator.
Note that when there are multiple matching classes when performing a fuzzy match, an instance of the first type-compatible class found is added.
In addition, it can be added even if the specified class's "Can be placed directly under the project" is not checked.
Arguments
Name | Type | Description |
---|---|---|
scope | IPackage | Scope (Package that is the base of the search range) |
className | string | Class name Specify the name of the class or the fully qualified name. Null or an empty string cannot be specified. |
fuzzy | bool | Fuzzy match option Whether to treat the className argument as the name of the class instead of the fully qualified name. If False, it will be evaluated as specifying a class whose fully qualified name matches className. If True, it will be evaluated as specifying a class whose class name matches className. The default value is True. |
Return value
Exception
Name | Exception class | Description |
---|---|---|
Invalid argument | ExtensionArgumentException | If null or an empty string is specified for className |
Class not found | ExtensionTypeNotFoundException | If the specified class is not found |