NDepend.API Documentation
NameLike Method
NDepend.Reserved.CQLinq Namespace > ExtensionMethodsCQLinqNaming Class : NameLike Method
This NDepend.CodeModel.ICodeElement object. A NDepend.CodeModel.ICodeElement object can be a NDepend.CodeModel.IAssembly, NDepend.CodeModel.INamespace, NDepend.CodeModel.IType, NDepend.CodeModel.IMethod or NDepend.CodeModel.IField object.
The regular expression is defined with the System.Text.RegularExpressions syntax.
The regular expression string can be suffixed with "\i" to specify the ignore case option.
Returns true if this codeElement.Name string matches the regular expression regexString. This method can only be called in a ICQLinqExecutionContext, otherwise the extension method NDepend.CodeModel.ExtensionMethodsNaming.NDepend.CodeModel.ExtensionMethodsNaming.WithNameLike<TCodeElement> must be called instead.
Syntax
[Extension()]
public static bool NameLike( 
   ICodeElement codeElement,
   string regexString
)

Parameters

codeElement
This NDepend.CodeModel.ICodeElement object. A NDepend.CodeModel.ICodeElement object can be a NDepend.CodeModel.IAssembly, NDepend.CodeModel.INamespace, NDepend.CodeModel.IType, NDepend.CodeModel.IMethod or NDepend.CodeModel.IField object.
regexString
The regular expression is defined with the System.Text.RegularExpressions syntax.
The regular expression string can be suffixed with "\i" to specify the ignore case option.
Exceptions
ExceptionDescription
This extension method cannot be called from a program consuming NDepend.API. In such context, the method NDepend.CodeModel.ExtensionMethodsNaming.NDepend.CodeModel.ExtensionMethodsNaming.WithNameLike<TCodeElement> must be called instead.
Remarks
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

ExtensionMethodsCQLinqNaming Class
ExtensionMethodsCQLinqNaming Members
Name Property
WithNameLike<TCodeElement> Method
WithName<TCodeElement> Method
WithNameIn<TCodeElement> Method
WithNameNotIn<TCodeElement> Method
WithNameWildcardMatch<TCodeElement> Method