Depends Class
Provides a way to specify dependencies of a method to properties or chains of properties. This class should be used from methods marked with the SafeForDependencyAnalysisAttribute custom attribute.
Inheritance Hierarchy
System.Object
  PostSharp.Patterns.Model.Depends

Namespace: PostSharp.Patterns.Model
Assembly: PostSharp.Patterns.Model (in PostSharp.Patterns.Model.dll) Version: 4.3.30.0 (4.3.30.0)
Syntax
C#
public static class Depends

The Depends type exposes the following members.

Methods
  NameDescription
Public methodStatic memberOn(Object)
Specifies an explicit dependency between the calling method and the argument passed to this method.
Public methodStatic memberOn(Object, Object)
Specifies an explicit dependency between the calling method and the arguments passed to this method.
Public methodStatic memberOn(Object, Object, Object)
Specifies an explicit dependency between the calling method and the arguments passed to this method.
Public methodStatic memberOn(Object, Object, Object, Object)
Specifies an explicit dependency between the calling method and the arguments passed to this method.
Public methodStatic memberOn(Object, Object, Object, Object, Object)
Specifies an explicit dependency between the calling method and the arguments passed to this method.
Public methodStatic memberOn(Object, Object, Object, Object, Object, Object)
Specifies an explicit dependency between the calling method and the arguments passed to this method.
Public methodStatic memberOn(Object, Object, Object, Object, Object, Object, Object)
Specifies an explicit dependency between the calling method and the arguments passed to this method.
Public methodStatic memberOn(Object, Object, Object, Object, Object, Object, Object, Object)
Specifies an explicit dependency between the calling method and the arguments passed to this method.
Public methodStatic memberOn(Object, Object, Object, Object, Object, Object, Object, Object, Object)
Specifies an explicit dependency between the calling method and the arguments passed to this method.
Public methodStatic memberOn(Object, Object, Object, Object, Object, Object, Object, Object, Object, Object)
Specifies an explicit dependency between the calling method and the arguments passed to this method.
Top
Fields
  NameDescription
Public fieldStatic memberGuard
A Boolean value that is always false.
Top
Remarks

Members of this class are considered metadata-only. They are used only at build time, where their arguments are decompiled. They have no runtime effect. For performance reason, it is preferable to skip their runtime execution. This can be achieved by using the Guard field in the construct:

if ( Depends.Guard )
{
  Depends.On(this.foo.Bar);
}
See Also