Table of Contents

Interface IUser

Namespace
NDepend.CodeModel
Assembly
NDepend.API.dll

Represents a code element that can use another code element. This interface is implemented by IMethod, IProperty, IEvent, IType, INamespace and IAssembly.

public interface IUser : ICodeElement, IUsed
Inherited Members
Extension Methods

Property (1)

Level

Gets a numeric nullable value indicating whether this assembly, namespace, type or method depends on a dependency cycle.

ushort? Level { get; }

Property Value

ushort?

Remarks

Level code metric description:
The Level value for a namespace is defined as follow:
  • Level = 0 : if the namespace doesn’t use any other namespace.
  • Level = 1 : if the namespace only uses directly namespace defined in third-party assemblies.
  • Level = 1 + (Max Level over namespace it uses direcly).
  • Level = null : if the namespace is involved in a dependency cycle or uses directly or indirectly a namespace involved in a dependency cycle.
Level metric definitions for assemblies, types and methods are inferred from the above definition. This metric has been first defined by John Lakos in his book Large-Scale C++ Software Design.

Recommendations: This metric helps objectively classify the assemblies, namespaces, types and methods as high level mid level or low level.
There is no particular recommendation for high or small values. This metric is also useful to discover dependency cycles in your application.

Methods (8)

IsUsing(ICodeElement)

Returns true if this code element is used by codeElementUsed, otherwise returns false.

bool IsUsing(ICodeElement codeElementUsed)

Parameters

codeElementUsed ICodeElement

The code element that is potentially used by this code element.

Returns

bool
See Also
Using<TUser, TUsed>(IEnumerable<TUser>, TUsed)

IsUsingAssembly(IAssembly)

Returns true if this code element is used by assemblyUsed, otherwise returns false.

bool IsUsingAssembly(IAssembly assemblyUsed)

Parameters

assemblyUsed IAssembly

The assembly that is potentially used by this code element.

Returns

bool

IsUsingEvent(IEvent)

Returns true if this code element is used by eventUsed, otherwise returns false.

bool IsUsingEvent(IEvent eventUsed)

Parameters

eventUsed IEvent

The event that is potentially used by this code element.

Returns

bool

IsUsingField(IField)

Returns true if this code element is used by fieldUsed, otherwise returns false.

bool IsUsingField(IField fieldUsed)

Parameters

fieldUsed IField

The field that is potentially used by this code element.

Returns

bool

IsUsingMethod(IMethod)

Returns true if this code element is used by methodUsed, otherwise returns false.

bool IsUsingMethod(IMethod methodUsed)

Parameters

methodUsed IMethod

The method that is potentially used by this code element.

Returns

bool

IsUsingNamespace(INamespace)

Returns true if this code element is used by namespaceUsed, otherwise returns false.

bool IsUsingNamespace(INamespace namespaceUsed)

Parameters

namespaceUsed INamespace

The namespace that is potentially used by this code element.

Returns

bool

IsUsingProperty(IProperty)

Returns true if this code element is used by propertyUsed, otherwise returns false.

bool IsUsingProperty(IProperty propertyUsed)

Parameters

propertyUsed IProperty

The property that is potentially used by this code element.

Returns

bool

IsUsingType(IType)

Returns true if this code element is used by typeUsed, otherwise returns false.

bool IsUsingType(IType typeUsed)

Parameters

typeUsed IType

The type that is potentially used by this code element.

Returns

bool

See Also