Interface IUser
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
Remarks
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.
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
codeElementUsedICodeElementThe code element that is potentially used by this code element.
Returns
- 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
assemblyUsedIAssemblyThe assembly that is potentially used by this code element.
Returns
IsUsingEvent(IEvent)
Returns true if this code element is used by eventUsed, otherwise returns false.
bool IsUsingEvent(IEvent eventUsed)
Parameters
eventUsedIEventThe event that is potentially used by this code element.
Returns
IsUsingField(IField)
Returns true if this code element is used by fieldUsed, otherwise returns false.
bool IsUsingField(IField fieldUsed)
Parameters
fieldUsedIFieldThe field that is potentially used by this code element.
Returns
IsUsingMethod(IMethod)
Returns true if this code element is used by methodUsed, otherwise returns false.
bool IsUsingMethod(IMethod methodUsed)
Parameters
methodUsedIMethodThe method that is potentially used by this code element.
Returns
IsUsingNamespace(INamespace)
Returns true if this code element is used by namespaceUsed, otherwise returns false.
bool IsUsingNamespace(INamespace namespaceUsed)
Parameters
namespaceUsedINamespaceThe namespace that is potentially used by this code element.
Returns
IsUsingProperty(IProperty)
Returns true if this code element is used by propertyUsed, otherwise returns false.
bool IsUsingProperty(IProperty propertyUsed)
Parameters
propertyUsedIPropertyThe property that is potentially used by this code element.
Returns
IsUsingType(IType)
Returns true if this code element is used by typeUsed, otherwise returns false.
bool IsUsingType(IType typeUsed)
Parameters
typeUsedITypeThe type that is potentially used by this code element.