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

Parameters

codeElementsUsed
This sequence of code elements.
codeElementUser
The code element that uses directly or indirectly code elements in the returned sequence.

Type Parameters

TUsed
The used code elements type that is IUsed or that implements IUsed.
TUser
The user code elements type that is IUser or that implements IUser.
Remarks
If codeElementUser or a child or parent of codeElementUser is in the returned sequence, its depth of usage is 0.
The depth of usage of a code element in codeElementsUsed, directly used by codeElementUser or a child or parent of codeElementUser, is 1.
And so forth.
This extension method has a O(codeElementsUsed.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
IsUsedBy Method
UsedByAny<TUsed,TUser> Method
UsedByAll<TUsed,TUser> Method
DepthOfIsUsedByAny<TUsed,TUser> Method