Difference between revisions of "Template:Context Intro Background"

From Ribbon Commander Documentation
Jump to: navigation, search
Line 3: Line 3:
 
The framework currently supports up to 1000 contexts/session so there is enough contexts to go around!
 
The framework currently supports up to 1000 contexts/session so there is enough contexts to go around!
  
In VBA (and this is specific to VBA) there are two types of contexts
+
In VBA (and this is specific to VBA) there are two types of contexts:
 
* Global context. Intended to be used with VBA standard modules. Delegates created by the [[rxCustomUI]] object of this context dispatch to <u>public</u> functions in <u>standard VBA modules</u>. The [[rxCustomUI]] object returned by the static function rxCustomUI.defaultInstance belongs to a global context.
 
* Global context. Intended to be used with VBA standard modules. Delegates created by the [[rxCustomUI]] object of this context dispatch to <u>public</u> functions in <u>standard VBA modules</u>. The [[rxCustomUI]] object returned by the static function rxCustomUI.defaultInstance belongs to a global context.
 
* Local context. Intended to be used with VBA classes. Delegates created by the [[rxCustomUI]] object of this context dispatch to members functions of the owning class.
 
* Local context. Intended to be used with VBA classes. Delegates created by the [[rxCustomUI]] object of this context dispatch to members functions of the owning class.

Revision as of 19:46, 10 March 2013

In previous examples we worked with the default rxCustomUI instance of the current session. This is fine for example code, but in real life it is preferable that each add-in/application creates its own context (or virtual add-in) to isolate its UI from other add-ins/applications.

The framework currently supports up to 1000 contexts/session so there is enough contexts to go around!

In VBA (and this is specific to VBA) there are two types of contexts:

  • Global context. Intended to be used with VBA standard modules. Delegates created by the rxCustomUI object of this context dispatch to public functions in standard VBA modules. The rxCustomUI object returned by the static function rxCustomUI.defaultInstance belongs to a global context.
  • Local context. Intended to be used with VBA classes. Delegates created by the rxCustomUI object of this context dispatch to members functions of the owning class.