Skip to main content

IProject.AddNewRootModel(string,bool) Method

Namespace: NextDesign.Core

Description

Adds a new model of the specified class to the project.
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

NameTypeDescription
classNamestringClass name
Specify the name of the class or the fully qualified name.
Null or an empty string cannot be specified.
fuzzyboolFuzzy 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

NameException classDescription
Invalid argumentExtensionArgumentExceptionIf null or an empty string is specified for className
Class not foundExtensionTypeNotFoundExceptionIf the specified class is not found