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

Parameters

userCodeElement
This NDepend.CodeModel.IUser object. A NDepend.CodeModel.IUser object can be a NDepend.CodeModel.IAssembly, NDepend.CodeModel.INamespace, NDepend.CodeModel.IType or NDepend.CodeModel.IMethod object.
usedMethodFullName
The NDepend.CodeModel.ICodeElement.FullName of the method used.
The string usedMethodFullName can contain wildcard '*' characters but cannot be just a single wildcard string "*".
If one or several methods are matched by usedMethodFullName, this method has a using any behavior.
Exceptions
ExceptionDescription
This extension method cannot be called from a program consuming NDepend.API. In such context, the method NDepend.CodeModel.IUser.NDepend.CodeModel.IUser.IsUsingMethod must be called instead.
Remarks
If one or several methods are matched by usedMethodFullName, 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