NDepend.API Documentation
DepthOfCreateA Method (ExtensionMethodsCQLinqDependency)
NDepend.Reserved.CQLinq Namespace > ExtensionMethodsCQLinqDependency Class : DepthOfCreateA Method
This method.
The NDepend.CodeModel.ICodeElement.FullName of the instantiated type.
The string createdTypeFullName can contain wildcard '*' characters but cannot be just a single wildcard string "*".
If one or several types are matched by createdTypeFullName, this method has a creates an instance of any behavior.
Returns a non-null depth value, if method is creating, directly or indirectly, an instance of a type, whose NDepend.CodeModel.ICodeElement.FullName is createdTypeFullName. This method can only be called in a ICQLinqExecutionContext, otherwise the extension method NDepend.CodeModel.ExtensionMethodsSequenceUsage.NDepend.CodeModel.ExtensionMethodsSequenceUsage.DepthOfCreateAny must be used instead.
Syntax
[Extension()]
public static Nullable<ushort> DepthOfCreateA( 
   IMethod method,
   string createdTypeFullName
)

Parameters

method
This method.
createdTypeFullName
The NDepend.CodeModel.ICodeElement.FullName of the instantiated type.
The string createdTypeFullName can contain wildcard '*' characters but cannot be just a single wildcard string "*".
If one or several types are matched by createdTypeFullName, this method has a creates an instance of any behavior.

Return Value

createdType being a NDepend.CodeModel.IType whose NDepend.CodeModel.ICodeElement.FullName is createdTypeFullName:
Returns null if method is not directly nor indirectly creating an instance of createdType.
Returns 0 if method is a constructor of createdType.
Returns 1 if method is calling a constructor of createdType.
Returns 2 if method is calling a method, that is calling a constructor of createdType.
...
If a non-null number is returned, returns the lowest possible number.
Exceptions
ExceptionDescription
This extension method cannot be called from a program consuming NDepend.API. In such context, the extension method NDepend.CodeModel.ExtensionMethodsSequenceUsage.NDepend.CodeModel.ExtensionMethodsSequenceUsage.DepthOfCreateAny must be used instead.
Remarks
If one or several types are matched by createdTypeFullName, they will be listed in NDepend.CodeQuery.IQueryExecutionSuccessResult.TargetCodeElements.
In the context of a CQLinq compiled query, this method has a constant time complexity.
Requirements

Target Platforms: Windows 11, 10, 8, 7and Linux, MacOS with net10.0, net9.0 or net8.0 installed

See Also

Reference

ExtensionMethodsCQLinqDependency Class
ExtensionMethodsCQLinqDependency Members
CreateA Method
ThatCreateA Method
ThatCreateAny Method
ThatIndirectlyCreateAny Method
DepthOfCreateA Method
DepthOfCreateAny Method
NDepend.Reserved.CQLinq.ExtensionMethodsCQLinqDependency.CreateA(NDepend.CodeModel.IMethod,System.String)
IndirectlyCreateA Method