Previous section   Next section

DependsOn

Specifies that this class should be compiled after the compiler has made other (specified) classes runnable.

Usage

To indicate that the class compiler should compile this class after other classes are runnable, use the following syntax:
Class MyApp.MyClass [ DependsOn = classlist ]  
{ //class members }
Where classlist is one of the following:
  • A class name. For example:
    [ DependsOn = MyApp.Class1 ]
    
  • A comma-separated list of class names, enclosed in parentheses. For example:
    [ DependsOn = (MyApp.Class1,MyApp.Class2,...) ]
    

Details

This keyword specifies that the class compiler should compile this class after making the specified classes runnable.
This keyword is useful if compilation of this class uses these other classes in the method generator logic. It is also useful if the class contains initial expressions that invoke other classes.
This keyword affects only compilation order, not runtime behavior.
Note:
The DependsOn keyword affects only classes with common values for the System keyword.
Also, if a class has DependsOn=ClassA, it is redundant for it to have CompileAfter=ClassA as well. See the CompileAfter keyword.

Effect on Subclasses

This keyword is inherited from all superclasses. If the subclass specifies a value for the keyword, that value specifies additional classes that must be runnable before the subclass can be compiled.

Default

By default, this keyword is not specified.

See Also

Previous section   Next section