|
Figure 1. Use a Hidden Path to Faster Code.
Your code can read a WithEvents variable as efficiently as a regular variable. The ILDASM utility reveals that WithEvents variables are actually rendered as properties (obj), which in turn are implemented as get/set methods (get_obj and set_obj). These methods are wrappers on a private variable the compiler has created automatically (_obj). You can use this hidden variable instead of the regular WithEvents variable to invoke methods of the corresponding object.
|