Difference between revisions of "Method create"
From Ribbon Commander Documentation
(→C#) |
(→C#) |
||
Line 35: | Line 35: | ||
=== C# === | === C# === | ||
<syntaxhighlight lang="csharp" line> | <syntaxhighlight lang="csharp" line> | ||
+ | // Create a new rxCustomUI in context 'cs_ribbon_context' | ||
+ | // The context doesn't exist at this point so it will get created | ||
rxCustomUI myCustomUI = rxCustomUI.create("cs_ribbon_context", "C# Ribbon"); | rxCustomUI myCustomUI = rxCustomUI.create("cs_ribbon_context", "C# Ribbon"); | ||
+ | |||
+ | // Create another rxCustomUI in context 'cs_ribbon_context' | ||
+ | // The context already exitsts at this point, so the new rxCustomUI will | ||
+ | // just join that context | ||
+ | rxCustomUI myCustomUI2 = rxCustomUI.create("cs_ribbon_context", "C# Ribbon"); | ||
+ | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 14:16, 14 March 2013
This section is under construction. Please do not rely on any information it contains.
Description
Static factory method for rxCustomUI objects. A new context if created if required.
Parameters
Parameter Name
|
Parameter Type
|
Default Value
|
Description
|
contextId | string | null | The context's unique string identifier |
description | string | 'Dynamic RibbonX' | The context's description |
dispatchScope | rxDispatchScope | DispatchScope_local | (VBA-specific) The context's dispatch mode |
customUIMode | rxCustomUIMode | CustomUIMode_dynamic | The context's mode |
Remarks
Examples
VBA
' Create an rxCustomUI with global dispatch
Dim myCustomUI As rxCustomUI
Set myCustomUI = rxCustomUI.create("my_sample_context", "My Global Context", DispatchScope_global)
' Create a second rxCustomUI in the same context but with local dispatch
Dim myCustomUI2 as rxCustomUI
Set myCustomUI2 = rxCustomUI.create("my_sample_context", "My Global Context", DispatchScope_local)
' NOTE: Both objects now have access to the same state
' NOTE2: Notice that the dispatch scope is a property of rxCustomUI; not its context. i.e. rxCustomUI's
' with different dispatch scopes belong to the same context above.
_
C#
// Create a new rxCustomUI in context 'cs_ribbon_context'
// The context doesn't exist at this point so it will get created
rxCustomUI myCustomUI = rxCustomUI.create("cs_ribbon_context", "C# Ribbon");
// Create another rxCustomUI in context 'cs_ribbon_context'
// The context already exitsts at this point, so the new rxCustomUI will
// just join that context
rxCustomUI myCustomUI2 = rxCustomUI.create("cs_ribbon_context", "C# Ribbon");