Table of Contents

Class ExtensionMethodsCQLinqNaming

Namespace
NDepend.Reserved.CQLinq
Assembly
NDepend.API.dll

Presents extension methods to match code elements and members by name, through regular expressions.

public static class ExtensionMethodsCQLinqNaming
Inheritance
ExtensionMethodsCQLinqNaming
Inherited Members

Remarks

These extension methods exist for CQLinq friendly syntax reasons and can only be called in a ICQLinqExecutionContext.
Indeed they all require a special regular expressions compilation step prior to query execution, that compiles once for all, specified regular expressions.
The user doesn't have to write this regular expressions compilation step. This results in less syntax burden.
For each of these extension methods, there are some corresponding methods in NDepend.CodeModel, that can be called to get the same action done.
This pre regular expression compilation step is weaved at CQLinq compilation time, the CQLinq compiler takes care of transforming calls to these extension methods adequately.
These extension methods cannot be called from a program consuming NDepend.API, since it would provoke regular expressions to be compiled for each code elements.

Methods (3)

FullNameLike(ICodeElement, string)

Returns true if this codeElement.FullName string matches the regular expression regexString. This method can only be called in a ICQLinqExecutionContext, otherwise the extension method ExtensionMethodsNaming.WithFullNameLike<TCodeElement>(IEnumerable<TCodeElement>, string) must be called instead.

public static bool FullNameLike(this ICodeElement codeElement, string regexString)

Parameters

codeElement ICodeElement

This ICodeElement object.

regexString string

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

bool

Remarks

In the context of a CQLinq compiled query, this method has a constant time complexity.

Exceptions

NotImplementedException

This extension method cannot be called from a program consuming NDepend.API. In such context, the method ExtensionMethodsNaming.WithFullNameLike<TCodeElement>(IEnumerable<TCodeElement>, string) must be called instead.

See Also
WithFullNameLike<TCodeElement>(IEnumerable<TCodeElement>, string)
WithFullName<TCodeElement>(IEnumerable<TCodeElement>, string)
WithFullNameIn<TCodeElement>(IEnumerable<TCodeElement>, string, params string[])
WithFullNameNotIn<TCodeElement>(IEnumerable<TCodeElement>, string, params string[])
WithFullNameWildcardMatch<TCodeElement>(IEnumerable<TCodeElement>, string)

NameLike(ICodeElement, string)

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 ExtensionMethodsNaming.WithNameLike<TCodeElement>(IEnumerable<TCodeElement>, string) must be called instead.

public static bool NameLike(this ICodeElement codeElement, string regexString)

Parameters

codeElement ICodeElement

This ICodeElement object. A ICodeElement object can be a IAssembly, INamespace, IType, IMethod or IField object.

regexString string

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

bool

Remarks

In the context of a CQLinq compiled query, this method has a constant time complexity.

Exceptions

NotImplementedException

This extension method cannot be called from a program consuming NDepend.API. In such context, the method ExtensionMethodsNaming.WithNameLike<TCodeElement>(IEnumerable<TCodeElement>, string) must be called instead.

See Also
WithNameLike<TCodeElement>(IEnumerable<TCodeElement>, string)
WithName<TCodeElement>(IEnumerable<TCodeElement>, string)
WithNameIn<TCodeElement>(IEnumerable<TCodeElement>, string, params string[])
WithNameNotIn<TCodeElement>(IEnumerable<TCodeElement>, string, params string[])
WithNameWildcardMatch<TCodeElement>(IEnumerable<TCodeElement>, string)

SimpleNameLike(ICodeElement, string)

Returns true if this codeElement.SimpleName string matches the regular expression regexString. This method can only be called in a ICQLinqExecutionContext, otherwise the extension method ExtensionMethodsNaming.WithFullNameLike<TCodeElement>(IEnumerable<TCodeElement>, string) must be called instead.

public static bool SimpleNameLike(this ICodeElement codeElement, string regexString)

Parameters

codeElement ICodeElement

This ICodeElement object.

regexString string

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

bool

Remarks

In the context of a CQLinq compiled query, this method has a constant time complexity.

Exceptions

NotImplementedException

This extension method cannot be called from a program consuming NDepend.API. In such context, the method ExtensionMethodsNaming.WithSimpleNameLike<TCodeElement>(IEnumerable<TCodeElement>, string) must be called instead.

See Also
WithSimpleNameLike<TCodeElement>(IEnumerable<TCodeElement>, string)
WithSimpleName<TCodeElement>(IEnumerable<TCodeElement>, string)
WithSimpleNameIn<TCodeElement>(IEnumerable<TCodeElement>, string, params string[])
WithSimpleNameNotIn<TCodeElement>(IEnumerable<TCodeElement>, string, params string[])
WithSimpleNameWildcardMatch<TCodeElement>(IEnumerable<TCodeElement>, string)