NDepend.API Documentation
DepthOfIsUsing<TUser,TUsed> Method (ExtensionMethodsSequenceUsage)
NDepend.CodeModel Namespace > ExtensionMethodsSequenceUsage Class : DepthOfIsUsing<TUser,TUsed> Method
The user code elements type that is IUser or that implements IUser.
The used code elements type that is IUsed or that implements IUsed.
This sequence of code elements.
The code element that is directly or indirectly used by code elements in the returned sequence.
Returns a ICodeMetric<TCodeElement,TNumeric> object whose DefinitionDomain is a sub-sequence of this sequence codeElementsUser, containing only code elements directly or indirectly using codeElementUsed. The metric value for each code element in DefinitionDomain is equal to the depth of usage.
Syntax
[Extension()]
public static ICodeMetric<TUser,ushort> DepthOfIsUsing<TUser,TUsed>( 
   IEnumerable<TUser> codeElementsUser,
   TUsed codeElementUsed
)
where TUser: class, IUser
where TUsed: class, ICodeElement

Parameters

codeElementsUser
This sequence of code elements.
codeElementUsed
The code element that is directly or indirectly used by code elements in the returned sequence.

Type Parameters

TUser
The user code elements type that is IUser or that implements IUser.
TUsed
The used code elements type that is IUsed or that implements IUsed.
Remarks
If codeElementUsed or a child or parent of codeElementUsed is in the returned sequence, its depth of usage is 0.
The depth of usage of a code element in codeElementsUser, directly using codeElementUsed or a child or parent of codeElementUsed, is 1.
And so forth.
This extension method has a O(codeElementsUser.Count) 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

ExtensionMethodsSequenceUsage Class
ExtensionMethodsSequenceUsage Members
IsUsing Method
UsingAny<TUser,TUsed> Method
UsingAll<TUser,TUsed> Method
DepthOfIsUsingAny<TUser,TUsed> Method