NDepend.API Documentation
IsUsedByAssembly Method (ExtensionMethodsCQLinqDependency)
NDepend.Reserved.CQLinq Namespace > ExtensionMethodsCQLinqDependency Class : IsUsedByAssembly Method
This NDepend.CodeModel.IUsed object. A NDepend.CodeModel.IUsed object can be a NDepend.CodeModel.IAssembly, NDepend.CodeModel.INamespace, NDepend.CodeModel.IMember, NDepend.CodeModel.IType, NDepend.CodeModel.IMethod or NDepend.CodeModel.IField object.
The Name of the assembly user.
The string userAssemblyName can contain wildcard '*' characters but cannot be just a single wildcard string "*".
If one or several assemblies are matched by userAssemblyName, this method has a used by any behavior.
Returns true if this usedCodeElement is directly used by a NDepend.CodeModel.IAssembly whose Name is userAssemblyName. This method can only be called in a ICQLinqExecutionContext, otherwise the method NDepend.CodeModel.IUsed.NDepend.CodeModel.IUsed.IsUsedByAssembly must be called instead.
Syntax
[Extension()]
public static bool IsUsedByAssembly( 
   IUsed usedCodeElement,
   string userAssemblyName
)

Parameters

usedCodeElement
This NDepend.CodeModel.IUsed object. A NDepend.CodeModel.IUsed object can be a NDepend.CodeModel.IAssembly, NDepend.CodeModel.INamespace, NDepend.CodeModel.IMember, NDepend.CodeModel.IType, NDepend.CodeModel.IMethod or NDepend.CodeModel.IField object.
userAssemblyName
The Name of the assembly user.
The string userAssemblyName can contain wildcard '*' characters but cannot be just a single wildcard string "*".
If one or several assemblies are matched by userAssemblyName, this method has a used by any behavior.
Exceptions
ExceptionDescription
This extension method cannot be called from a program consuming NDepend.API. In such context, the method NDepend.CodeModel.IUsed.NDepend.CodeModel.IUsed.IsUsedByAssembly must be called instead.
Remarks
If one or several assemblies are matched by userAssemblyName, 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, 7 and Linux, MacOS with net8.0, net7.0 or net6.0 installed

See Also

Reference

ExtensionMethodsCQLinqDependency Class
ExtensionMethodsCQLinqDependency Members