Class CommandBarController
The CommandBarController acts as a central point of control for the CommandBars hosted on a form.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Tools
Assembly: Syncfusion.Tools.Windows.dll
Syntax
public class CommandBarController : BaseComponent, IThemeProvider, IDisposable, ISupportInitialize, ICBControllerDesignerInvoke, IVisualStyle
Remarks
The Essential Tools CommandBars framework implements a hosting environment that can be used for creating toolbars, statusbars and rebars similar to those that are present in the Microsoft Visual Studio.NET IDE and the Microsoft Office XP product suite. A CommandBar, similar to Win32/MFC control bars, is purely a container control that is responsible only for it's layout state and it is the client window, such as a ToolBar, StatusBar or any other Windows Forms control, that provides the CommandBar with it's functional identity.
CommandBars have two basic states - a docked state and a floating state. In the docked state, the CommandBars are usually aligned along one of the borders (left, right, top or bottom) of the host form. Depending upon the preferences set, the bar can either take up an entire row as in the case of a menu or share it's space with other bars within a particular row as with toolbars and rebars. By default, a docked CommandBar has a gripper and a drop-down button with a customizable click event. The gripper can be used to reposition the bar within a row, move it between rows and to drag it out of the frame and float as a separate window. In the docked mode, when the row width is adequate, the CommandBars are usually sized to their maximum length. However, reducing the frame width/height will, based on the user-setting, force the CommandBar to reduce in size while retaining the same height or wrap thereby increasing the bar height. The wrapping mode is particularly useful for toolbars and is fully customizable. In the floating state, the CommandBar is parented by a floating window that can dragged around the desktop. A floating CommandBar can be redocked to it's host by either double-clicking it or by dragging it over one of the edges of the host form.
The CommandBarController class, as the name implies, serves as a form-scope controller for all the CommandBars. Attributes that are common across all CommandBars within a host form, such as the EnabledDockBorders and PersistState are usually set on the CommandBarController instance. The CommandBarController implements the API and the requisite design-time support for creating and working with CommandBars.
Examples
The sample code shows how to create and initialize a CommandBarController, create a CommandBar control that is initially docked to the top border of the form and hosts a Panel control and finally add the CommandBar to the CommandBarController's collection.
private void InitializeCommandBars()
{
// Create the CommandBarController
this.commandBarController1 = new Syncfusion.Windows.Forms.Tools.CommandBarController();
((System.ComponentModel.ISupportInitialize)(this.commandBarController1)).BeginInit();
// Set the CommandBarController's host form
this.commandBarController1.HostForm = this;
this.commandBarController1.PersistState = true;
// Create the CommandBar control
this.commandBarAddress = new Syncfusion.Windows.Forms.Tools.CommandBar();
// Set the CommandBar Layout/Behavior/Appearance attributes
this.commandBarAddress.DockBorder = Syncfusion.Windows.Forms.Tools.DockBorder.Top;
this.commandBarAddress.HideDropDownButton = true;
this.commandBarAddress.MaxLength = 400;
this.commandBarAddress.MinHeight = 26;
this.commandBarAddress.MinLength = 50;
this.commandBarAddress.Name = "commandBarAddress";
this.commandBarAddress.RowIndex = 1;
this.commandBarAddress.RowOffset = 1;
this.commandBarAddress.Text = "Address";
// Create the ComboBox control and add it to the CommandBars Controls collection
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.commandBarAddress.Controls.AddRange(new System.Windows.Forms.Control[] {this.comboBox1});
// Add the CommandBar to the CommandBarController.CommandBars collection
this.commandBarController1.CommandBars.Add(this.commandBarAddress);
((System.ComponentModel.ISupportInitialize)(this.commandBarController1)).EndInit();
}</code></pre></coderef>
Private Sub InitializeCommandBars()
' Create the CommandBarController
Me.commandBarController1 = New Syncfusion.Windows.Forms.Tools.CommandBarController(Me.components)
CType(Me.commandBarController1, System.ComponentModel.ISupportInitialize).BeginInit()
' Set the CommandBarController's host form
Me.commandBarController1.HostForm = Me
Me.commandBarController1.PersistState = True
' Create the CommandBar control
Me.commandBarAddress = New Syncfusion.Windows.Forms.Tools.CommandBar()
' Set the CommandBar Layout/Behavior/Appearance attributes
Me.commandBarAddress.DockState = Syncfusion.Windows.Forms.Tools.CommandBarDockState.Top
Me.commandBarAddress.MaxLength = 400
Me.commandBarAddress.MinHeight = 26
Me.commandBarAddress.MinLength = 50
Me.commandBarAddress.Name = "commandBarAddress"
Me.commandBarAddress.RowIndex = 1
Me.commandBarAddress.RowOffset = 1
Me.commandBarAddress.Text = "Address"
' Create the ComboBox control and add it to the CommandBars Controls collection
Me.comboBox1 = New System.Windows.Forms.ComboBox()
Me.commandBarAddress.Controls.AddRange(New System.Windows.Forms.Control() {Me.comboBox1})
' Add the CommandBar to the CommandBarControllers CommandBars // collection
Me.commandBarController1.CommandBars.Add(Me.commandBarAddress)
CType(Me.commandBarController1, System.ComponentModel.ISupportInitialize).EndInit()
End Sub</code></pre></coderef>
Constructors
CommandBarController()
Overloaded. Creates a new instance of the CommandBarController.
Declaration
public CommandBarController()
CommandBarController(IContainer)
Creates a new instance of the CommandBarController and initializes it with the container.
Declaration
public CommandBarController(IContainer container)
Parameters
Type | Name | Description |
---|---|---|
System.ComponentModel.IContainer | container | An object implementing the System.ComponentModel.IContainer interface to associate with this instance of the CommandBarController. |
Fields
alCommandBars
Declaration
protected CommandBarController.CommandBarsCollection alCommandBars
Field Value
alDelayLoadBars
Declaration
protected ArrayList alDelayLoadBars
Field Value
Type |
---|
System.Collections.ArrayList |
alFreezeAddBars
Declaration
protected ArrayList alFreezeAddBars
Field Value
Type |
---|
System.Collections.ArrayList |
alFreezeRelayoutBars
Declaration
protected ArrayList alFreezeRelayoutBars
Field Value
Type |
---|
System.Collections.ArrayList |
alFreezeRemoveBars
Declaration
protected ArrayList alFreezeRemoveBars
Field Value
Type |
---|
System.Collections.ArrayList |
bBackColorSet
Declaration
protected bool bBackColorSet
Field Value
Type |
---|
System.Boolean |
bDisableButtons
Declaration
protected bool bDisableButtons
Field Value
Type |
---|
System.Boolean |
bInitializationComplete
Declaration
protected bool bInitializationComplete
Field Value
Type |
---|
System.Boolean |
bLoadVisibility
Declaration
protected bool bLoadVisibility
Field Value
Type |
---|
System.Boolean |
bPersistState
Declaration
protected bool bPersistState
Field Value
Type |
---|
System.Boolean |
bThemesEnabled
Declaration
protected bool bThemesEnabled
Field Value
Type |
---|
System.Boolean |
cbDockBorder
Declaration
protected CommandBarDockBorder cbDockBorder
Field Value
Type |
---|
CommandBarDockBorder |
clrBackColor
Declaration
protected Color clrBackColor
Field Value
Type |
---|
System.Drawing.Color |
CommandDockBarB
Declaration
protected CommandDockBar CommandDockBarB
Field Value
Type |
---|
CommandDockBar |
CommandDockBarL
Declaration
protected CommandDockBar CommandDockBarL
Field Value
Type |
---|
CommandDockBar |
CommandDockBarR
Declaration
protected CommandDockBar CommandDockBarR
Field Value
Type |
---|
CommandDockBar |
CommandDockBarT
Declaration
protected CommandDockBar CommandDockBarT
Field Value
Type |
---|
CommandDockBar |
focusedCBar
Declaration
protected CommandBar focusedCBar
Field Value
Type |
---|
CommandBar |
frmMain
Declaration
protected Form frmMain
Field Value
Type |
---|
System.Windows.Forms.Form |
m_office2007Theme
Colorschemes for Office2007 visual style.
Declaration
protected Office2007Theme m_office2007Theme
Field Value
Type |
---|
Office2007Theme |
m_office2010Theme
Colorschemes for Office2010 visual style.
Declaration
protected Office2010Theme m_office2010Theme
Field Value
Type |
---|
Office2010Theme |
nFreezeActivation
Need this to avoid recursive mdichild and owned forms activating. Especially issue occurs when activating mdichild form, which is in minimized state, and has some floating forms related to it's ChildBarManager.
Declaration
protected int nFreezeActivation
Field Value
Type |
---|
System.Int32 |
nFreezeLayout
Declaration
protected int nFreezeLayout
Field Value
Type |
---|
System.Int32 |
strmDefault
Declaration
protected MemoryStream strmDefault
Field Value
Type |
---|
System.IO.MemoryStream |
strPersistKey
Declaration
protected const string strPersistKey = "CommandBarInfo"
Field Value
Type |
---|
System.String |
tbStyle
Declaration
protected VisualStyle tbStyle
Field Value
Type |
---|
VisualStyle |
typeCBSerializer
Declaration
protected Type typeCBSerializer
Field Value
Type |
---|
System.Type |
wndMainFrm
Declaration
protected CommandBarController.AppMainFormWnd wndMainFrm
Field Value
wpprCBController
Declaration
protected CBCtrlrSerializationWrapper wpprCBController
Field Value
Properties
BackColor
Gets or sets the background color used to draw the host form's dockable regions.
Declaration
public Color BackColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | A System.Drawing.Color that represents the background color. |
Remarks
The dockable region is the area along the HostForm's border on which the CommandBars are docked. The CommandBarController uses the specified color for drawing the Form's dockable regions.
CommandBars
Returns a reference to the CommandBars that belong to this CommandBarController.
Declaration
public CommandBarController.CommandBarsCollection CommandBars { get; }
Property Value
Type | Description |
---|---|
CommandBarController.CommandBarsCollection | A CommandBarController.CommandBarsCollection that contains the CommandBars in this CommandBarController. |
CommandBarSerializer
Gets or sets the CommandBarSerializer
Declaration
public Type CommandBarSerializer { get; set; }
Property Value
Type |
---|
System.Type |
EnabledDockBorders
Gets or sets the edges of the form along which CommandBars are allowed to dock.
Declaration
public CommandBarDockBorder EnabledDockBorders { get; set; }
Property Value
Type | Description |
---|---|
CommandBarDockBorder | A CommandBarDockBorder value specifying the dockable edges. |
FocusedCommandBar
Declaration
protected CommandBar FocusedCommandBar { get; set; }
Property Value
Type |
---|
CommandBar |
FreezeActivation
Declaration
protected bool FreezeActivation { get; set; }
Property Value
Type |
---|
System.Boolean |
FreezeLayout
Gets or sets FreezeLayout
Declaration
public bool FreezeLayout { get; set; }
Property Value
Type |
---|
System.Boolean |
HostForm
Gets or sets the host form.
Declaration
public Form HostForm { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.Form | The Form that will host the CommandBars. |
MetroBackColor
Gets or Sets the MetroColor
Declaration
public Color MetroBackColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
MetroColor
Gets or Sets the MetroColor
Declaration
public Color MetroColor { get; set; }
Property Value
Type |
---|
System.Drawing.Color |
Office2007ColorTable
Gets colors for Office2007 visual style.
Declaration
protected Office2007Colors Office2007ColorTable { get; }
Property Value
Type |
---|
Office2007Colors |
Office2007Theme
Gets or sets colorschemes for Office2007 visual style.
Declaration
public Office2007Theme Office2007Theme { get; set; }
Property Value
Type |
---|
Office2007Theme |
Office2010ColorTable
Gets colors for Office2010 visual style.
Declaration
protected Office2010Colors Office2010ColorTable { get; }
Property Value
Type |
---|
Office2010Colors |
Office2010Theme
Gets or sets colorschemes for Office2010 visual style.
Declaration
public Office2010Theme Office2010Theme { get; set; }
Property Value
Type |
---|
Office2010Theme |
PersistenceID
Declaration
protected virtual string PersistenceID { get; }
Property Value
Type |
---|
System.String |
PersistState
Indicates whether the application's CommandBars state should be persisted.
Declaration
public bool PersistState { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | When TRUE the application's CommandBars state will be persisted. The default is FALSE. |
RightToLeft
Gets a value indicating whether the control's elements are aligned RightToLeft.
Declaration
public virtual RightToLeft RightToLeft { get; }
Property Value
Type |
---|
System.Windows.Forms.RightToLeft |
Style
Gets or sets the visual style of the CommandBars.
Declaration
public VisualStyle Style { get; set; }
Property Value
Type | Description |
---|---|
VisualStyle | A VisualStyle value. Default is VisualStyle.OfficeXP. |
Remarks
Note that this setting will be ignored when ThemesEnabled is turned on and themes are available in the OS.
ThemesEnabled
Indicates whether XP Themes (visual styles) should be used for CommandBars.
Declaration
public bool ThemesEnabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | True to turn on themes; false otherwise. |
ThemeStyle
Gets or sets the CommandBarControllerVisualStyle value used to customize the appearance of the CommandBarController.
Declaration
public CommandBarControllerVisualStyle ThemeStyle { get; set; }
Property Value
Remarks
This ThemeStyle settings will be applied only when the VisualStyleBased theme has been applied to the control.
UseBackwardCompatiblity
Declaration
public bool UseBackwardCompatiblity { get; set; }
Property Value
Type |
---|
System.Boolean |
Methods
ApplyDeserializedState(IEnumerator)
Declaration
[Obsolete("This method will be removed in a future version. Please use the more flexible ApplyDeserializedState(IList) variant, instead.")]
protected void ApplyDeserializedState(IEnumerator ebarlist)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.IEnumerator | ebarlist |
ApplyDeserializedState(IList)
Declaration
protected void ApplyDeserializedState(IList ebarlist)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.IList | ebarlist |
BeginInit()
Begins the initialization of the CommandBarController component.
Declaration
public virtual void BeginInit()
BringToFront()
Brings the CommandBar to the front of the z-order.
Declaration
public void BringToFront()
ChildControl_DockChanged(Object, EventArgs)
Declaration
protected void ChildControl_DockChanged(object sender, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | |
System.EventArgs | e |
CreateCommandDockBar()
Declaration
protected virtual CommandDockBar CreateCommandDockBar()
Returns
Type |
---|
CommandDockBar |
Dispose(Boolean)
Overridden. See System.ComponentModel.Component.Dispose(System.Boolean).
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
EndInit()
Ends the initialization of the CommandBarController component.
Declaration
public virtual void EndInit()
GetCommandBarsList()
Gets the list of commandBars in the commandBars Collection.
Declaration
public virtual CommandBarController.CommandBarsCollection GetCommandBarsList()
Returns
GetControlName(String)
Helps to override the ControlName settings in control
Declaration
public override string GetControlName(string controlName)
Parameters
Type | Name | Description |
---|---|---|
System.String | controlName |
Returns
Type |
---|
System.String |
Overrides
GetDockBar(CommandBarDockBorder)
Gets the Dock bar
Declaration
public CommandDockBar GetDockBar(CommandBarDockBorder dockstyle)
Parameters
Type | Name | Description |
---|---|---|
CommandBarDockBorder | dockstyle |
Returns
Type |
---|
CommandDockBar |
GetDockBar(CommandBarDockState)
Declaration
protected CommandDockBar GetDockBar(CommandBarDockState border)
Parameters
Type | Name | Description |
---|---|---|
CommandBarDockState | border |
Returns
Type |
---|
CommandDockBar |
GetDockBar(Point)
Declaration
protected CommandDockBar GetDockBar(Point ptscreen)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | ptscreen |
Returns
Type |
---|
CommandDockBar |
GetPersistanceData()
Declaration
protected virtual CBCtrlrSerializationWrapper GetPersistanceData()
Returns
HostForm_BackColorChanged(Object, EventArgs)
Declaration
protected void HostForm_BackColorChanged(object sender, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | |
System.EventArgs | e |
HostForm_Closing(Object, CancelEventArgs)
Declaration
protected void HostForm_Closing(object sender, CancelEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | |
System.ComponentModel.CancelEventArgs | e |
HostForm_ControlAdded(Object, ControlEventArgs)
Declaration
protected void HostForm_ControlAdded(object sender, ControlEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | |
System.Windows.Forms.ControlEventArgs | e |
HostForm_ControlRemoved(Object, ControlEventArgs)
Declaration
protected void HostForm_ControlRemoved(object sender, ControlEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | |
System.Windows.Forms.ControlEventArgs | e |
HostForm_Layout(Object, LayoutEventArgs)
Declaration
protected void HostForm_Layout(object sender, LayoutEventArgs levent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | |
System.Windows.Forms.LayoutEventArgs | levent |
HostForm_Load(Object, EventArgs)
Declaration
protected void HostForm_Load(object sender, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | |
System.EventArgs | e |
HostForm_RightToLeftChanged(Object, EventArgs)
Declaration
protected void HostForm_RightToLeftChanged(object sender, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | |
System.EventArgs | e |
HostForm_SystemColorsChanged(Object, EventArgs)
Declaration
protected void HostForm_SystemColorsChanged(object sender, EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | |
System.EventArgs | e |
InitializeCBController()
Declaration
protected void InitializeCBController()
InitializeDockBars()
Declaration
protected virtual void InitializeDockBars()
LayoutDockBarsExceptBar(CommandDockBar)
Layout the bars which are docked.
Declaration
public void LayoutDockBarsExceptBar(CommandDockBar dockBarToIgnore)
Parameters
Type | Name | Description |
---|---|---|
CommandDockBar | dockBarToIgnore | The dock bar which should be ignored while layouting. |
LoadCommandBarState()
Overloaded. Retrieves the persisted state of the CommandBar objects from Isolated Storage.
Declaration
public bool LoadCommandBarState()
Returns
Type | Description |
---|---|
System.Boolean | TRUE if the load is successful; FALSE otherwise. |
See Also
LoadCommandBarState(AppStateSerializer)
Retrieves the persisted state of the CommandBar objects using the specified AppStateSerializer.
Declaration
public bool LoadCommandBarState(AppStateSerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
AppStateSerializer | serializer | An instance of AppStateSerializer, from which to load. |
Returns
Type | Description |
---|---|
System.Boolean | TRUE if the load is successful. |
Remarks
Reads the CommandBar state information from the specified persistent store and applies the new state. This method has been provided only to allow a higher degree of control over the serialization process. For normal state storage and retrieval it is highly recommended that you use the SaveCommandBarState(AppStateSerializer) and LoadCommandBarState(AppStateSerializer) methods.
LoadCommandBarState(SerializeMode, Object)
Retrieves the persisted state of the CommandBar objects using the specified storage and location.
Declaration
[Obsolete("This method will be removed in a future version. Please use the more flexible LoadCommandBarState(AppStateSerializer) variant, instead.", false)]
public bool LoadCommandBarState(SerializeMode mode, object persistpath)
Parameters
Type | Name | Description |
---|---|---|
SerializeMode | mode | A SerializeMode value describing the persistence medium. |
System.Object | persistpath | The name of the IsolatedStorage/INI/XML file or registry key containing the persisted information. |
Returns
Type | Description |
---|---|
System.Boolean | TRUE if the load is successful. |
Remarks
Reads the CommandBar state information from the specified persistent store and applies the new state. This method has been provided only to allow a higher degree of control over the serialization process. For normal state storage and retrieval it is highly recommended that you use the SaveCommandBarState(AppStateSerializer) and LoadCommandBarState(AppStateSerializer) methods.
This method will be removed in a future version. Please use the more flexible LoadCommandBarState(AppStateSerializer) variant, instead.
LoadCommandBarStateFromCache(CommandBar)
Loads the command bar state from cache
Declaration
public void LoadCommandBarStateFromCache(CommandBar cbar)
Parameters
Type | Name | Description |
---|---|---|
CommandBar | cbar |
LoadDesignerCommandBarState()
Restores the default state of the CommandBar objects.
Declaration
public bool LoadDesignerCommandBarState()
Returns
Type | Description |
---|---|
System.Boolean | TRUE if the load is successful. |
Remarks
Loads the state set within the designer.
OnDockBarStateChanged(CommandBarController.DockBarStateEventArgs)
Declaration
protected virtual void OnDockBarStateChanged(CommandBarController.DockBarStateEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
CommandBarController.DockBarStateEventArgs | args |
OnProvidePresistenceID(ProvidePersistenceIDEventArgs)
Raises the ProvidePersisteceID event.
Declaration
protected virtual void OnProvidePresistenceID(ProvidePersistenceIDEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
ProvidePersistenceIDEventArgs | e | An ProvidePersistenceIDEventArgs object containing data pertaining to this event. |
Remarks
The OnProvidePresistenceID method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
Notes to Inheritors: When overriding OnProvidePresistenceID in a derived class, be sure to call the base class's OnProvidePresistenceID method so that registered delegates receive the event.
OnStyleChanged()
Raises the StyleChanged event.
Declaration
protected virtual void OnStyleChanged()
OnThemeNameChanged(String)
Helps to apply the ThemeName settings in control
Declaration
public override void OnThemeNameChanged(string themeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | themeName | ThemeName |
Overrides
OnThemesEnabledChanged()
Raises the ThemesEnabledChanged event.
Declaration
protected virtual void OnThemesEnabledChanged()
ReadDeserializedData(CommandBar)
Reads deserialized data to CommandBar.
Declaration
protected virtual void ReadDeserializedData(CommandBar commandBar)
Parameters
Type | Name | Description |
---|---|---|
CommandBar | commandBar |
RecalcBorderLayout(CommandBarDockState)
Declaration
protected void RecalcBorderLayout(CommandBarDockState border)
Parameters
Type | Name | Description |
---|---|---|
CommandBarDockState | border |
RecalcLayout(CommandBar)
Forces a layout recalculation on the specified CommandBar.
Declaration
public void RecalcLayout(CommandBar cbar)
Parameters
Type | Name | Description |
---|---|---|
CommandBar | cbar | The CommandBar for which the layout is to be recalculated. |
RecalcLayout(CommandBarDockBorder)
Overloaded. Forces a layout recalculation.
Declaration
public void RecalcLayout(CommandBarDockBorder style)
Parameters
Type | Name | Description |
---|---|---|
CommandBarDockBorder | style | A CommandBarDockBorder value representing the CommandBar position. |
Remarks
Forces a recalculation of all CommandBars occupied by the state specified by the CommandBarDockBorder value.
RemoveCommandBarData(CommandBar)
Declaration
protected virtual void RemoveCommandBarData(CommandBar commandBar)
Parameters
Type | Name | Description |
---|---|---|
CommandBar | commandBar |
ResetBackColor()
Resumes the back color to default value.
Declaration
public void ResetBackColor()
ResetDockBarZOrder()
Resumes the dock bar z-order to default value.
Declaration
public void ResetDockBarZOrder()
SaveCommandBarState()
Overloaded. Persists the current state of the CommandBar objects to IsolatedStorage.
Declaration
public void SaveCommandBarState()
See Also
SaveCommandBarState(AppStateSerializer)
Persists the current state of the CommandBar objects using the specified AppStateSerializer.
Declaration
public void SaveCommandBarState(AppStateSerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
AppStateSerializer | serializer | A reference to the AppStateSerializer instance. |
Remarks
Writes the CommandBar state information onto the persistence medium. This method has been provided only to allow a higher degree of control over the serialization process. For normal state storage and retrieval it is highly recommended that you use the SaveCommandBarState(AppStateSerializer) and LoadCommandBarState(AppStateSerializer) methods.
SaveCommandBarState(SerializeMode, Object)
Persists the current state of the CommandBar objects using the specified storage medium and location.
Declaration
[Obsolete("This method will be removed in a future version. Please use the more flexible SaveCommandBarState(AppStateSerializer) variant, instead.", false)]
public void SaveCommandBarState(SerializeMode mode, object persistpath)
Parameters
Type | Name | Description |
---|---|---|
SerializeMode | mode | A SerializeMode value describing the persistence medium. |
System.Object | persistpath | The name of the IsolatedStorage/INI/XML file or registry key in which the state information is to be persisted. |
Remarks
Writes the CommandBar state information onto the persistence medium specified by the
mode
parameter and at the path specified by the persistpath
object.
This method has been provided only to allow a higher degree of control over the
serialization process. For normal state storage and retrieval it is highly recommended that
you use the SaveCommandBarState(AppStateSerializer) and
LoadCommandBarState(AppStateSerializer) methods.
This method will be removed in a future version. Please use the more flexible SaveCommandBarState(AppStateSerializer) variant, instead.
SendToBack()
Sends the CommandBar to the back of the z-order.
Declaration
public void SendToBack()
SetBarsTransparency()
Declaration
protected void SetBarsTransparency()
SetCommandBarInitialPosition(CommandBar)
Declaration
protected void SetCommandBarInitialPosition(CommandBar cbar)
Parameters
Type | Name | Description |
---|---|---|
CommandBar | cbar |
SetInitialDockedPosition(CommandBar)
Declaration
protected void SetInitialDockedPosition(CommandBar cbar)
Parameters
Type | Name | Description |
---|---|---|
CommandBar | cbar |
SetInitialFloatingPosition(CommandBar)
Declaration
protected void SetInitialFloatingPosition(CommandBar cbar)
Parameters
Type | Name | Description |
---|---|---|
CommandBar | cbar |
ShouldSerializeBackColor()
Declaration
protected bool ShouldSerializeBackColor()
Returns
Type |
---|
System.Boolean |
ToggleCommandBarFloatState(Boolean)
Declaration
protected void ToggleCommandBarFloatState(bool bactivate)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | bactivate |
Events
DockBarStateChanged
Declaration
protected event CommandBarController.DockBarStateChangedHandler DockBarStateChanged
Event Type
LayoutResumed
Occurs when CommandBars' layout is internally resumed.
Declaration
public event EventHandler LayoutResumed
Event Type
Type |
---|
System.EventHandler |
LayoutSuspended
Occurs when CommandBars' layout is internally suspended.
Declaration
public event EventHandler LayoutSuspended
Event Type
Type |
---|
System.EventHandler |
ProvidePersisteceID
Lets you specify a unique ID used to distinguish the persistence information of different instances of your Form type.
Declaration
[Obsolete("ProvidePersisteceID is deprecated, please use ProvidePersistenceID instead.")]
public event ProvidePersistenceIDEventHandler ProvidePersisteceID
Event Type
Remarks
The default persistence logic assumes that there will be only a single CommandBarController in an application. But that might not be the case if you have more than 1 MDI parent. In such cases, the persisted state of one MDI parent will get overridden by the other since the default logic doesn't distinguish these 2 different instances.
ProvidePersistenceID
Lets you specify a unique ID used to distinguish the persistence information of different instances of your Form type.
Declaration
public event ProvidePersistenceIDEventHandler ProvidePersistenceID
Event Type
Remarks
The default persistence logic assumes that there will be only a single CommandBarController in an application. But that might not be the case if you have more than 1 MDI parent. In such cases, the persisted state of one MDI parent will get overridden by the other since the default logic doesn't distinguish these 2 different instances.
StyleChanged
Occurs when the Style property is changed.
Declaration
public event EventHandler StyleChanged
Event Type
Type |
---|
System.EventHandler |
ThemesEnabledChanged
Occurs when the ThemesEnabled property is changed.
Declaration
public event EventHandler ThemesEnabledChanged
Event Type
Type |
---|
System.EventHandler |
Explicit Interface Implementations
IVisualStyle.VisualTheme
Declaration
string IVisualStyle.VisualTheme { get; set; }
Returns
Type |
---|
System.String |
ICBControllerDesignerInvoke.GetCommandDockBarB()
Declaration
CommandDockBar ICBControllerDesignerInvoke.GetCommandDockBarB()
Returns
Type |
---|
CommandDockBar |
ICBControllerDesignerInvoke.GetCommandDockBarL()
Declaration
CommandDockBar ICBControllerDesignerInvoke.GetCommandDockBarL()
Returns
Type |
---|
CommandDockBar |
ICBControllerDesignerInvoke.GetCommandDockBarR()
Declaration
CommandDockBar ICBControllerDesignerInvoke.GetCommandDockBarR()
Returns
Type |
---|
CommandDockBar |
ICBControllerDesignerInvoke.GetCommandDockBarT()
Declaration
CommandDockBar ICBControllerDesignerInvoke.GetCommandDockBarT()
Returns
Type |
---|
CommandDockBar |
ICBControllerDesignerInvoke.InitializeCBController()
Declaration
void ICBControllerDesignerInvoke.InitializeCBController()