C# Class SIL.FieldWorks.Common.UIAdapters.TMAdapter

The main class from which DotNetBar MenuAdapter and ToolBarAdapter classes are derived.
Inheritance: ITMAdapter
显示文件 Open project: sillsdev/FieldWorks

Protected Properties

Property Type Description
m_allowPopupToBeCanceled bool
m_allowUndocking bool
m_allowuUpdates bool
m_appsRegKeyPath Microsoft.Win32.RegistryKey
m_appsRegKeyPath string
m_barLocations Point>.Dictionary
m_barReadFromSettingFile bool
m_bars ToolStrip>.Dictionary
m_commandInfo CommandInfo>.Dictionary
m_contextMenus ContextMenuStrip>.Dictionary
m_customizeMenuShowing bool
m_displayedBars bool>.Dictionary
m_hiddenSeparators ToolStripSeparator>.Dictionary
m_htBarLocations System.Collections.Hashtable
m_htCommandInfo System.Collections.Hashtable
m_htControls System.Collections.Hashtable
m_htFormTypeCommands System.Collections.Hashtable
m_htImages System.Collections.Hashtable
m_htItemTags System.Collections.Hashtable
m_htSettingsFileLoaded System.Collections.Hashtable
m_htSystemStringIds System.Collections.Hashtable
m_htWndListIndices System.Collections.Hashtable
m_images Image>.Dictionary
m_itemUpdateTime System.DateTime
m_menuBar System.Windows.Forms.MenuStrip
m_menuCurrentlyPoppedUp DevComponents.DotNetBar.ButtonItem
m_menuCurrentlyPoppedUp System.Windows.Forms.ContextMenuStrip
m_menusWithShortcuts System.Collections.ArrayList
m_menusWithShortcuts System.Windows.Forms.ToolStripItemCollection
m_moreWindowItem DevComponents.DotNetBar.ButtonItem
m_moreWindowItem System.Windows.Forms.ToolStripMenuItem
m_msgMediator XCore.Mediator
m_parentForm System.Windows.Forms.Form
m_readingContextMenuDef bool
m_rmlocalMngmntStrings System.Resources.ResourceManager
m_rmlocalStrings System.Collections.ArrayList
m_rmlocalStrings List
m_separators ToolStripSeparator>.Dictionary
m_settingFiles string[]
m_settingsFilePrefix string
m_tmItems ToolStripItem>.Dictionary
m_toolBarMenuMap ToolStrip>.Dictionary
m_toolbarCustomizeItem DevComponents.DotNetBar.ButtonItem
m_toolbarListItem DevComponents.DotNetBar.ButtonItem
m_toolbarListItem System.Windows.Forms.ToolStripMenuItem
m_tsContainer System.Windows.Forms.ToolStripContainer
m_tsPanel System.Windows.Forms.ToolStripPanel
m_windowListItem DevComponents.DotNetBar.ButtonItem
m_windowListItem System.Windows.Forms.ToolStripMenuItem
m_windowListItemClicked System.Windows.Forms.ToolStripMenuItem
m_xmlReader System.Xml.XmlTextReader

Private Properties

Property Type Description
AddMenuItem void
AddMenuItem void
AddToCustomizationCollection void
AllowAppsToIntializeComboItems void
BarFromSettingFile Bar
BuildToolbarList void
BuildWindowList void
CancelMenuOpen bool
CancelMenuPopup bool
CheckAssemblyVersion void
CheckDefinitionDates void
ClearWindowListFromWindowMenu void
CompareBarProps int
CreateDropDownToolBarItem System.Windows.Forms.ToolStripItem
CreateNormalToolBarItem System.Windows.Forms.ToolStripItem
DeleteSettingsFiles void
DisposeCollection void
FindSubMenu DevComponents.DotNetBar.ButtonItem
FormatDateTime string
GetCommandInfo CommandInfo
GetCommandInfo CommandInfo
GetCustomControlHost System.Windows.Forms.ToolStripControlHost
GetFileDateTime System.DateTime
GetImageListFromResourceAssembly System.Windows.Forms.ImageList
GetItemProps SIL.FieldWorks.Common.UIAdapters.TMItemProperties
GetItemProps SIL.FieldWorks.Common.UIAdapters.TMItemProperties
GetSettingFilesPrefix void
GetToolBarItemDisplayStyle ToolStripItemDisplayStyle
HandleControlContainerLoadRequests void
HandleCustomizeMenuPopup void
HandleGettingLocalizedString void
HandleItemClicks void
HandleItemUpdates void
HandleItemsPopup void
HandleMenuClosed void
HandleMenuOpened void
HandleMenuOpening void
HandleMenuPopupClose void
HandleMenuPopups void
HandleToolBarItemDropDownOpened void
HandleToolBarItemUpdates void
HandleToolBarListMenuClosing void
HandleUserCustomize void
HandleWindowMenuClosing void
HideInitialSeparators void
InitDNBManager void
InitItem void
InitItem void
InitToolStripContainer void
InitialBarPropsComparer int
InitializeCustomizeItemPopupHandlers void
InsertMenuItem void
InsertMenuItem void
LoadBarSettings bool
LoadCustomBarsFromSettings void
LoadDefaultToolbarLayout void
MakeNewBar Bar
MakeNewBar System.Windows.Forms.ToolStrip
ParseDateTime System.DateTime
ParseShortcutKeyString Keys
PositionToolbars void
ReadContextMenus void
ReadImagesResources void
ReadMenuDefinitions void
ReadMenuItems void
ReadResourcesAndCommands void
ReadSingleToolbarDef void
ReadSystemStringIds void
ReadToolbarDefinitions void
ReadToolbarItems void
RemoveContextMenuItems void
SetBarProperties void
SetBarProperties void
SetButtonItemSpecificProperties void
SetComboItemSpecificProperties void
SetComboItemSpecificProperties void
SetItemProps void
SetItemProps void
SetupDocSite DevComponents.DotNetBar.DockSite

Public Methods

Method Description
AddContextMenuItem ( SIL.FieldWorks.Common.UIAdapters.TMItemProperties itemProps, string contextMenuName, string insertBeforeItem ) : void

Adds a new menu item to a context menu specified by contextMenuName and inserts it before the item specified by insertBeforeItem. If insertBeforeItem is null, then the new menu item is added to the end of parentItemName's menu collection.

AddContextMenuItem ( SIL.FieldWorks.Common.UIAdapters.TMItemProperties itemProps, string contextMenuName, string parentMenuName, string insertBeforeItem ) : void

Adds a new menu item to a context menu specified by contextMenuName and inserts it before the item specified by insertBeforeItem. If insertBeforeItem is null, then the new menu item is added to the end of parentItemName's menu collection. This overload allows new menu items to be added as submenus to menus at the top level of the context menu. The parentMenuName can be the name of a menu item at any level within the hierarchy of the menus on the context menu.

AddMenuItem ( SIL.FieldWorks.Common.UIAdapters.TMItemProperties itemProps, string parentItemName, string insertBeforeItem ) : void

Adds a new submenu item to the menu specified by parentItemName and inserts it before the item specified by insertBeforeItem. If insertBeforeItem is null, then the new submenu item is added to the end of parentItemName's menu collection.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

GetBarItemControl ( string name ) : Control

Gets the control contained within a control container toolbar item.

GetBarProperties ( string name ) : SIL.FieldWorks.Common.UIAdapters.TMBarProperties

Gets the properties of a toolbar.

GetItemProperties ( string name ) : SIL.FieldWorks.Common.UIAdapters.TMItemProperties

Loads a TMItemProperties object with several properties from a toolbar item.

HideBarItemsPopup ( string name ) : void

Allows an application to force the hiding of a toolbar item's popup control.

HideToolBar ( string name ) : void

Allows an application to hide a toolbar.

Initialize ( Form parentForm, Control contentControl, XCore.Mediator msgMediator, string definitions ) : void

Initialize ( Form parentForm, Control contentControl, XCore.Mediator msgMediator, string appsRegKeyPath, string definitions ) : void

Initialize ( Form parentForm, XCore.Mediator msgMediator, string definitions ) : void

Initialize ( Form parentForm, XCore.Mediator msgMediator, string appsRegKeyPath, string definitions ) : void

IsShortcutKey ( Keys key, bool &isItemEnabled ) : bool

Determines whether the specified Keys is a shortcut for a toolbar or menu item.

PopupMenu ( string name, int x, int y ) : void

Pops-up a menu so it shows like a context menu. If the item doesn't have any sub items, then this command is ignored.

PopupMenu ( string name, int x, int y, List subItemsToRemoveOnClose ) : void

Pops-up a menu so it shows like a context menu. If the item doesn't have any sub items, then this command is ignored.

RemoveMenuItem ( string parentItemName, string name ) : void

Removes the specified item from the specified parent menu.

Removing submenu items on a menu, while leaving the parent menu intact has not been tested (and is not currently needed).

RemoveMenuSubItems ( string parentItemName ) : void

Removes all the subitems of the specified menu.

SaveBarSettings ( ) : void

Causes the adapter to save toolbar settings (e.g. user placement of toolbars).

SetBarProperties ( SIL.FieldWorks.Common.UIAdapters.TMBarProperties barProps ) : void

Sets the properties of the main menu bar. object.

SetBarProperties ( string name, SIL.FieldWorks.Common.UIAdapters.TMBarProperties barProps ) : void

Sets properties for a menu bar or toolbar.

SetContextMenuForControl ( Control ctrl, string name ) : void

Sets the context menu for a specified control.

SetItemProperties ( string name, SIL.FieldWorks.Common.UIAdapters.TMItemProperties itemProps ) : void

Sets some of a toolbar item's properties. Note: if the Update property in the TMItemProperties object hasn't been set to true, no updating will occur.

SetParentForm ( Form newForm ) : Form

Sets the adapter's parent form. This will not cause docking sites to be added to the form and DotNetBar manager. This solves TE-6793

ShowCustomizeDialog ( ) : void

Causes the adapter to show it's dialog for customizing toolbars.

ShowToolBar ( string name ) : void

Allows an application to show a toolbar.

Protected Methods

Method Description
CallItemUpdateHandler ( DevComponents.DotNetBar.BaseItem item ) : void

This is a helper method for the HandleMenuPopups and HandleItemUpdates methods. It accepts a single DNB item and calls it's update handler, if there is one.

CallItemUpdateHandler ( ToolStripItem item ) : void

This is a helper method for the HandleMenuOpening and HandleItemUpdates methods. It calls the update handler for the specified ToolStripItem item.

CallUpdateHandlersForCollection ( ToolStripItemCollection collection ) : void

Calls the update handlers for collection.

Dispose ( bool fDisposing ) : void
GetAssembly ( string assemblyName ) : Assembly

Loads a named assembly.

GetAttributeValue ( XmlNode node, string attribute ) : string

Gets an attribute's value from the specified node.

GetBoolFromAttribute ( XmlNode node, string attribute ) : bool

GetBoolFromAttribute ( XmlNode node, string attribute, bool defaultValue ) : bool

GetIntFromAttribute ( XmlNode node, string attribute, int defaultValue ) : int

GetItemsCommandMessage ( DevComponents.DotNetBar.BaseItem item ) : string

Gets an item's command handling message from the appropriate hash table entry.

GetItemsCommandMessage ( ToolStripItem item ) : string

Gets an item's command handling message from the appropriate hash table entry.

GetResourceMngr ( XmlNode node ) : ResourceManager

GetStringFromResource ( string kstid ) : string

GetToolbarItem ( XmlNode node, string name ) : DevComponents.DotNetBar.BaseItem

Gets a toolbar item with the specified name. If the item exists, then return the one found in the DNB manager. Otherwise, create a new one.

GetToolbarItem ( XmlNode node, string name ) : ToolStripItem

Gets a toolbar item with the specified name. If the item exists, return it. Otherwise, create a new one.

GetWindowIndex ( DevComponents.DotNetBar.ButtonItem item, SIL.FieldWorks.Common.UIAdapters.TMItemProperties itemProps ) : void

GetWindowIndex ( ToolStripItem item, SIL.FieldWorks.Common.UIAdapters.TMItemProperties itemProps ) : void

HandleBuildingWindowList ( object sender, CancelEventArgs e ) : void

Handles the building window list.

HandleMessageMediatorDisposed ( object sender, EventArgs e ) : void

Handles the Disposed event of the m_msgMediator control.

HandleToolBarItemDropDownClosed ( object sender, EventArgs e ) : void

Send a message to anyone who cares that the drop down is closing.

ReadCommands ( XmlNode node ) : void

Reads the commands section of a definition file.

ReadOverJunk ( XmlNode node ) : XmlNode

Skips over white space and any other junk that's not considered an element or end element.

ReadSingleItem ( XmlNode node, bool isMenuItem ) : DevComponents.DotNetBar.BaseItem

Read the information for a single menu item from the specified node.

ReadSingleItem ( XmlNode node, bool isMenuItem ) : ToolStripItem

Read the information for a single menu item from the specified node.

m_parentForm_Shown ( object sender, EventArgs e ) : void

Locate the toolbars when their parent form is shown.

Private Methods

Method Description
AddMenuItem ( DevComponents.DotNetBar.ButtonItem item, string refItemName ) : void

Finds the item specified by refItemName and Adds the specified item to the ref. item's collection of sub items.

AddMenuItem ( ToolStripMenuItem item, string refItemName ) : void

Finds the item specified by refItemName and Adds the specified item to the ref. item's collection of sub items.

AddToCustomizationCollection ( XmlNode node, DevComponents.DotNetBar.BaseItem item, bool isMenuItem ) : void

At this point, the item passed to this method has not been added to any toolbar or menu. Before doing so, we need to add it to the DNB Manager because that internally (to the DNB manager) assigns the item to its category and makes it available for customization purposes through DNB's customize dialog. But, only add an item if there is a category for the item and if the item is not a ControlContainerItem. We don't allow ControlContainerItems because it appears DotNetBar's customize dialog doesn't allow dragging new copies of ControlContainerItems to user-defined toolbars. And if they don't allow that, I don't want them in the list appearing like they should be able to be dragged to new toolbars. This means a DotNetBar manager may only have one (visible - See comments in HandleControlContainerLoadRequests) instance of application-defined toolbar items.

AllowAppsToIntializeComboItems ( ) : void

This method gets the combobox items and fires the InitializeComboItem event in case the application wants to initialize the combo box.

BarFromSettingFile ( string barName ) : Bar

If the toolbar has a settings file (i.e. a file that was saved when the application was last closed) then restore the toolbar from it.

BuildToolbarList ( ) : void

Initialize list of available toolbars.

BuildWindowList ( ) : void

CancelMenuOpen ( ) : bool

Determines whether or not a menu should be allowed to be popped-up (See TE-6553).

CancelMenuPopup ( ) : bool

Determines whether or not a menu should be allowed to be popped-up (See TE-6553).

CheckAssemblyVersion ( ) : void

Checks if the current adapter assembly version has changed since the last time the application was run.

CheckDefinitionDates ( string definitions ) : void

This method checks the date and time of the TM definition files to see if they are newer than they were the last time the application was run. If one or more of them are newer, then all the toolbar settings files written by DotNetBar are deleted so the toolbars will be completely reconstructed from the TM definition files.

ClearWindowListFromWindowMenu ( ToolStripMenuItem windowMenu ) : void

Clear out the window list after it's parent closes.

CompareBarProps ( SIL.FieldWorks.Common.UIAdapters.TMBarProperties x, SIL.FieldWorks.Common.UIAdapters.TMBarProperties y ) : int

CreateDropDownToolBarItem ( XmlNode node, int type ) : ToolStripItem

Creates one of three different types of drop-down toolbar items.

CreateNormalToolBarItem ( XmlNode node ) : ToolStripItem

Creates a normal (in the sense that it's not a combo box, custom control, drop-down item, etc.) toolbar item.

DeleteSettingsFiles ( ) : void

Deletes the toolbar settings files created by DotNetBar in the SaveSettings method.

DisposeCollection ( IEnumerable enumerable ) : void
FindSubMenu ( DevComponents.DotNetBar.ButtonItem parentMenu, string menuToFind ) : DevComponents.DotNetBar.ButtonItem

Search recursively through the a menu and any submenus for the specified menu name.

FormatDateTime ( System.DateTime dt ) : string

Format a date/time in our custom format

GetCommandInfo ( DevComponents.DotNetBar.BaseItem item ) : CommandInfo

GetCommandInfo ( ToolStripItem item ) : CommandInfo

GetCustomControlHost ( string name, string commandId ) : ToolStripControlHost

Gets a custom control and return it in a returned ToolStripControlHost.

GetFileDateTime ( string fileName ) : System.DateTime

Get the date/time for a file in UTC. We do this to get the date/time in a consistent format without milliseconds.

GetImageListFromResourceAssembly ( string assemblyName, string className, string field ) : ImageList

GetItemProps ( DevComponents.DotNetBar.BaseItem item ) : SIL.FieldWorks.Common.UIAdapters.TMItemProperties

Loads a TMItemProperties object with several properties from a toolbar item.

GetItemProps ( ToolStripItem item ) : SIL.FieldWorks.Common.UIAdapters.TMItemProperties

Loads a TMItemProperties object with several properties from a toolbar item.

GetSettingFilesPrefix ( string definitions ) : void

Examines the XML definition files to find which one (if any) have the prefix used for storing toolbar settings.

GetToolBarItemDisplayStyle ( XmlNode node ) : ToolStripItemDisplayStyle

Returns a display style read from a toolbar item node.

HandleControlContainerLoadRequests ( object sender, EventArgs e ) : void

This method gets called by the DotNetBar manager when it needs a control to load into a ControlContainerItem. The adapter then, fires the LoadControlContainerItem event to allow applications to give the adapter an application-defined control.

HandleCustomizeMenuPopup ( object sender, EventArgs e ) : void

This method gets called whenever a customize menu (i.e. the menu that pops-up when clicking or hovering over the "Add or Remove Buttons" item) opens or closes. When the menu opens, a flag is set so item updates are not performed (in the HandleItemUpdates method). I found that when the menu popped-up and HandleItemUpdates iterated through the items, sometimes the iterating through the items seemed to grab some of the items on the customize menu. Iterating through the items the way I did in HandleItemUpdates should never have returned items that show up on the customize menu, but it happened and I think there's a DNB bug. This works around it.

HandleGettingLocalizedString ( object sender, DevComponents.DotNetBar.LocalizeEventArgs e ) : void

This gets called when the DotNetBar requests a localized version of a string for displaying in places like the dialog that lets the user configure toolbars (e.g. show/hide toolbars, add new ones, etc.).

HandleItemClicks ( object sender, EventArgs e ) : void

This method handles clicks on toolbar/menu items.

HandleItemUpdates ( object sender, EventArgs e ) : void

While the system is idle (or about to become so), this method will go through all the toolbar items and make sure they are enabled properly for the current view. Then it will go through the menu items with shortcuts to make sure they're enabled properly. (This is only done every 0.75 seconds.)

HandleItemsPopup ( object sender, EventArgs e ) : void

Handles clicks on the drop-down portion of a popup button (i.e. a click on the arrow portion of a two-segmented toolbar button).

HandleMenuClosed ( object sender, System.Windows.Forms.ToolStripDropDownClosedEventArgs e ) : void

Handles the restoring visibility of ToolStripSeparators hidden in HideInitialSeparators.

HandleMenuOpened ( object sender, EventArgs e ) : void

When a menu item is popped-up, then cycle through the subitems and call update handlers.

HandleMenuOpening ( object sender, CancelEventArgs e ) : void

Determines whether or not a menu should be allowed to be popped-up (See TE-6553).

HandleMenuPopupClose ( object sender, EventArgs e ) : void

When a popup menu is closed, begin showing tooltips again. Also, if there were items to remove from the menu, remove them from the menu.

HandleMenuPopups ( object sender, DevComponents.DotNetBar.PopupOpenEventArgs e ) : void

When a menu item is popped-up, then cycle through the subitems and call update handlers.

HandleToolBarItemDropDownOpened ( object sender, EventArgs e ) : void

Handles clicks on the drop-down portion of a popup button (i.e. a click on the arrow portion of a two-segmented toolbar button).

HandleToolBarItemUpdates ( object sender, EventArgs e ) : void

While the system is idle (or about to become so), this method will go through all the toolbar items and make sure they are enabled properly for the current view. Then it will go through the menu items with shortcuts to make sure they're enabled properly. (This is only done every 0.75 seconds.)

HandleToolBarListMenuClosing ( object sender, EventArgs e ) : void

Trap this event so we can clear the toolbar list item when it closes.

HandleUserCustomize ( object sender, EventArgs e ) : void

This catches all item customize events and only cares about the ones where the user is adding custom toolbars. By default, when adding custom toolbars, the DotNetBar manager makes them floating and puts them in the upper left corner of the screen. I thought that was not very user friendly so I trap the addition of new toolbars and dock them to the top of the application window.

HandleWindowMenuClosing ( object sender, EventArgs e ) : void

Clear out the window list after it's parent closes.

HideInitialSeparators ( ToolStripDropDown dropDown ) : void

Goes through the collection of ToolStripItems in the specified drop-down and hides the first visible item if it's a ToolStripSeparator. If the second (or beyond) item is also visible and a ToolStripSeparator, then it/they won't be hidden. We have our limits. If that becomes a problem, then ENHANCE: to cover that problem.

InitDNBManager ( Form parentForm ) : void

Creates a DotNetBar manager.

InitItem ( XmlNode node, DevComponents.DotNetBar.BaseItem item, string name, bool isMenuItem ) : void

This method initializes a toolbar or menu item's properties.

InitItem ( XmlNode node, ToolStripItem item, string name, bool isMenuItem ) : void

This method initializes a toolbar or menu item's properties.

InitToolStripContainer ( Form parentForm, Control contentControl ) : void

Creates a ToolStripContainer control.

InitialBarPropsComparer ( InitialBarProps x, InitialBarProps y ) : int

Compares the locations and visibility of two toolstrip objects.

InitializeCustomizeItemPopupHandlers ( ) : void

This method gets the customize items for all the toolbars and subscribes to the ExpandChange event so we know when customize menus open and close.

InsertMenuItem ( DevComponents.DotNetBar.ButtonItem item, string refItemName, bool cancelBeginGroup ) : void

Finds the item specified by refItemName and inserts the specified item before it in the collection to which refItemName belongs.

InsertMenuItem ( ToolStripItem item, string refItemName ) : void

Finds the item specified by refItemName and inserts the specified item before it in the collection to which refItemName belongs.

LoadBarSettings ( ) : bool

Load tool bar settings from the registry, if available.

LoadCustomBarsFromSettings ( ) : void

LoadDefaultToolbarLayout ( ) : void

Positions the toolbars to the positions specified in the xml deffinition file. This method only gets called when tool bar locations and visibilities cannot be found in the registry.

MakeNewBar ( XmlNode node, string barName ) : Bar

Make a new toolbar and initialize it based on what's in the XML definition.

MakeNewBar ( XmlNode node, string barName ) : ToolStrip

Make a new toolbar and initialize it based on what's in the XML definition.

ParseDateTime ( string dateString ) : System.DateTime

Parse our custom date/time string. If the string is not valid, then return an empty date/time

ParseShortcutKeyString ( string shortcut ) : Keys

Parses the specified shortcut key string.

PositionToolbars ( ) : void

Positions the toolbars to the positions specified in the xml deffinition file.

ReadContextMenus ( XmlNode node ) : void

Builds all context menus, adding them to the DNB manager's list of context menus.

ReadImagesResources ( XmlNode node ) : void

Get the images from the resource specified in the XML definition.

ReadMenuDefinitions ( string definitions ) : void

ReadMenuItems ( XmlNode node, object parentItem, bool readingContextMenus ) : void

Recursively builds menus.

ReadResourcesAndCommands ( string definitions ) : void

ReadSingleToolbarDef ( XmlNode node ) : void

ReadSystemStringIds ( ) : void

Reads the strings to localize what DotNetBar uses internally (e.g. on their customize toolbar dialog).

ReadToolbarDefinitions ( string definitions ) : void

Iterates through the toolbar definitions to read the XML.

ReadToolbarItems ( XmlNode node, object parentItem ) : void

RemoveContextMenuItems ( ContextMenuStrip cmnu ) : void

Remove a list of context menu sub items found in the tag property of the specified context menu.

SetBarProperties ( Bar bar, SIL.FieldWorks.Common.UIAdapters.TMBarProperties barProps ) : void

Sets properties for a menu bar or toolbar.

SetBarProperties ( ToolStrip bar, SIL.FieldWorks.Common.UIAdapters.TMBarProperties barProps ) : void

Sets properties for a menu bar or toolbar.

SetButtonItemSpecificProperties ( DevComponents.DotNetBar.ButtonItem item, SIL.FieldWorks.Common.UIAdapters.TMItemProperties itemProps ) : void

Sets the properties for a ButtonItem type toolbar button.

SetComboItemSpecificProperties ( DevComponents.DotNetBar.ComboBoxItem item, SIL.FieldWorks.Common.UIAdapters.TMItemProperties itemProps ) : void

Sets the items in the Items collection for a ComboBoxItem type toolbar item.

SetComboItemSpecificProperties ( ToolStripComboBox cbo, SIL.FieldWorks.Common.UIAdapters.TMItemProperties itemProps ) : void

Sets the items in the Items collection for a ComboBoxItem type toolbar item.

SetItemProps ( DevComponents.DotNetBar.BaseItem item, SIL.FieldWorks.Common.UIAdapters.TMItemProperties itemProps ) : void

Sets some of a menu/toolbar item's properties. Note: if the Update property in the TMItemProperties object hasn't been set to true, no updating will occur. Items that can be set are: Text, Category, Tooltip, Enabled, Visible, BeginGroup, Checked, Image, List, Tag, and CommandId;

SetItemProps ( ToolStripItem item, SIL.FieldWorks.Common.UIAdapters.TMItemProperties itemProps ) : void

Sets some of a menu/toolbar item's properties. Note: if the Update property in the TMItemProperties object hasn't been set to true, no updating will occur. Items that can be set are: Text, Category, Tooltip, Enabled, Visible, BeginGroup, Checked, Image, List, Tag, and CommandId;

SetupDocSite ( DockStyle dockStyle ) : DevComponents.DotNetBar.DockSite

Creates a DotNetBar docking site for a DotNetBar toolbar.

Method Details

AddContextMenuItem() public method

Adds a new menu item to a context menu specified by contextMenuName and inserts it before the item specified by insertBeforeItem. If insertBeforeItem is null, then the new menu item is added to the end of parentItemName's menu collection.
public AddContextMenuItem ( SIL.FieldWorks.Common.UIAdapters.TMItemProperties itemProps, string contextMenuName, string insertBeforeItem ) : void
itemProps SIL.FieldWorks.Common.UIAdapters.TMItemProperties Properties of the new menu item.
contextMenuName string Name of the context menu to which the item is added. ///
insertBeforeItem string Name of the context menu item before which the new /// menu item will be added.
return void

AddContextMenuItem() public method

Adds a new menu item to a context menu specified by contextMenuName and inserts it before the item specified by insertBeforeItem. If insertBeforeItem is null, then the new menu item is added to the end of parentItemName's menu collection. This overload allows new menu items to be added as submenus to menus at the top level of the context menu. The parentMenuName can be the name of a menu item at any level within the hierarchy of the menus on the context menu.
public AddContextMenuItem ( SIL.FieldWorks.Common.UIAdapters.TMItemProperties itemProps, string contextMenuName, string parentMenuName, string insertBeforeItem ) : void
itemProps SIL.FieldWorks.Common.UIAdapters.TMItemProperties Properties of the new menu item.
contextMenuName string Name of the context menu to which the item is added. ///
parentMenuName string Name of the menu item in the context menu under which /// the new item is added.
insertBeforeItem string Name of the context menu item before which the new /// menu item will be added.
return void

AddMenuItem() public method

Adds a new submenu item to the menu specified by parentItemName and inserts it before the item specified by insertBeforeItem. If insertBeforeItem is null, then the new submenu item is added to the end of parentItemName's menu collection.
public AddMenuItem ( SIL.FieldWorks.Common.UIAdapters.TMItemProperties itemProps, string parentItemName, string insertBeforeItem ) : void
itemProps SIL.FieldWorks.Common.UIAdapters.TMItemProperties Properties of the new menu item.
parentItemName string Name of the menu item that will be added to.
insertBeforeItem string Name of the submenu item before which the new /// menu item will be added.
return void

CallItemUpdateHandler() protected method

This is a helper method for the HandleMenuPopups and HandleItemUpdates methods. It accepts a single DNB item and calls it's update handler, if there is one.
protected CallItemUpdateHandler ( DevComponents.DotNetBar.BaseItem item ) : void
item DevComponents.DotNetBar.BaseItem
return void

CallItemUpdateHandler() protected method

This is a helper method for the HandleMenuOpening and HandleItemUpdates methods. It calls the update handler for the specified ToolStripItem item.
protected CallItemUpdateHandler ( ToolStripItem item ) : void
item System.Windows.Forms.ToolStripItem
return void

CallUpdateHandlersForCollection() protected method

Calls the update handlers for collection.
protected CallUpdateHandlersForCollection ( ToolStripItemCollection collection ) : void
collection System.Windows.Forms.ToolStripItemCollection The collection.
return void

Dispose() public method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool fDisposing ) : void
fDisposing bool
return void

GetAssembly() protected method

Loads a named assembly.
protected GetAssembly ( string assemblyName ) : Assembly
assemblyName string
return System.Reflection.Assembly

GetAttributeValue() protected method

Gets an attribute's value from the specified node.
protected GetAttributeValue ( XmlNode node, string attribute ) : string
node System.Xml.XmlNode
attribute string
return string

GetBarItemControl() public method

Gets the control contained within a control container toolbar item.
public GetBarItemControl ( string name ) : Control
name string Name of the control container item.
return System.Windows.Forms.Control

GetBarProperties() public method

Gets the properties of a toolbar.
public GetBarProperties ( string name ) : SIL.FieldWorks.Common.UIAdapters.TMBarProperties
name string Name of the toolbar whose properties are being requested. ///
return SIL.FieldWorks.Common.UIAdapters.TMBarProperties

GetBoolFromAttribute() protected method

protected GetBoolFromAttribute ( XmlNode node, string attribute ) : bool
node System.Xml.XmlNode
attribute string
return bool

GetBoolFromAttribute() protected method

protected GetBoolFromAttribute ( XmlNode node, string attribute, bool defaultValue ) : bool
node System.Xml.XmlNode
attribute string
defaultValue bool
return bool

GetIntFromAttribute() protected method

protected GetIntFromAttribute ( XmlNode node, string attribute, int defaultValue ) : int
node System.Xml.XmlNode
attribute string
defaultValue int
return int

GetItemProperties() public method

Loads a TMItemProperties object with several properties from a toolbar item.
public GetItemProperties ( string name ) : SIL.FieldWorks.Common.UIAdapters.TMItemProperties
name string The Name of the item whose properties are being stored.
return SIL.FieldWorks.Common.UIAdapters.TMItemProperties

GetItemsCommandMessage() protected method

Gets an item's command handling message from the appropriate hash table entry.
protected GetItemsCommandMessage ( DevComponents.DotNetBar.BaseItem item ) : string
item DevComponents.DotNetBar.BaseItem
return string

GetItemsCommandMessage() protected method

Gets an item's command handling message from the appropriate hash table entry.
protected GetItemsCommandMessage ( ToolStripItem item ) : string
item System.Windows.Forms.ToolStripItem
return string

GetResourceMngr() protected method

protected GetResourceMngr ( XmlNode node ) : ResourceManager
node System.Xml.XmlNode
return System.Resources.ResourceManager

GetStringFromResource() protected method

protected GetStringFromResource ( string kstid ) : string
kstid string
return string

GetToolbarItem() protected method

Gets a toolbar item with the specified name. If the item exists, then return the one found in the DNB manager. Otherwise, create a new one.
protected GetToolbarItem ( XmlNode node, string name ) : DevComponents.DotNetBar.BaseItem
node System.Xml.XmlNode
name string
return DevComponents.DotNetBar.BaseItem

GetToolbarItem() protected method

Gets a toolbar item with the specified name. If the item exists, return it. Otherwise, create a new one.
protected GetToolbarItem ( XmlNode node, string name ) : ToolStripItem
node System.Xml.XmlNode
name string
return System.Windows.Forms.ToolStripItem

GetWindowIndex() protected method

protected GetWindowIndex ( DevComponents.DotNetBar.ButtonItem item, SIL.FieldWorks.Common.UIAdapters.TMItemProperties itemProps ) : void
item DevComponents.DotNetBar.ButtonItem
itemProps SIL.FieldWorks.Common.UIAdapters.TMItemProperties
return void

GetWindowIndex() protected method

protected GetWindowIndex ( ToolStripItem item, SIL.FieldWorks.Common.UIAdapters.TMItemProperties itemProps ) : void
item System.Windows.Forms.ToolStripItem
itemProps SIL.FieldWorks.Common.UIAdapters.TMItemProperties
return void

HandleBuildingWindowList() protected method

Handles the building window list.
protected HandleBuildingWindowList ( object sender, CancelEventArgs e ) : void
sender object
e CancelEventArgs
return void

HandleMessageMediatorDisposed() protected method

Handles the Disposed event of the m_msgMediator control.
protected HandleMessageMediatorDisposed ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

HandleToolBarItemDropDownClosed() protected method

Send a message to anyone who cares that the drop down is closing.
protected HandleToolBarItemDropDownClosed ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

HideBarItemsPopup() public method

Allows an application to force the hiding of a toolbar item's popup control.
public HideBarItemsPopup ( string name ) : void
name string Name of item whose popup should be hidden.
return void

HideToolBar() public method

Allows an application to hide a toolbar.
public HideToolBar ( string name ) : void
name string Name of toolbar to hide.
return void

Initialize() public method

public Initialize ( Form parentForm, Control contentControl, XCore.Mediator msgMediator, string definitions ) : void
parentForm System.Windows.Forms.Form
contentControl System.Windows.Forms.Control
msgMediator XCore.Mediator
definitions string
return void

Initialize() public method

public Initialize ( Form parentForm, Control contentControl, XCore.Mediator msgMediator, string appsRegKeyPath, string definitions ) : void
parentForm System.Windows.Forms.Form
contentControl System.Windows.Forms.Control
msgMediator XCore.Mediator
appsRegKeyPath string Registry key path (under HKCU) where application's /// settings are stored (default is "Software\SIL\FieldWorks").
definitions string
return void

Initialize() public method

public Initialize ( Form parentForm, XCore.Mediator msgMediator, string definitions ) : void
parentForm System.Windows.Forms.Form
msgMediator XCore.Mediator
definitions string
return void

Initialize() public method

public Initialize ( Form parentForm, XCore.Mediator msgMediator, string appsRegKeyPath, string definitions ) : void
parentForm System.Windows.Forms.Form
msgMediator XCore.Mediator
appsRegKeyPath string Registry key path (under HKCU) where application's /// settings are stored (default is "Software\SIL\FieldWorks").
definitions string
return void

IsShortcutKey() public method

Determines whether the specified Keys is a shortcut for a toolbar or menu item.
public IsShortcutKey ( Keys key, bool &isItemEnabled ) : bool
key Keys The key.
isItemEnabled bool true when the specified key is a shortcut key /// and its associated toolbar or menu item is enabled.
return bool

PopupMenu() public method

Pops-up a menu so it shows like a context menu. If the item doesn't have any sub items, then this command is ignored.
public PopupMenu ( string name, int x, int y ) : void
name string The name of the item to popup. The name could be the name of /// a menu off the application's menu bar, or one of the context menu's added to the /// menu adapter.
x int The X location (on the screen) where the menu is popped-up.
y int The Y location (on the screen) where the menu is popped-up.
return void

PopupMenu() public method

Pops-up a menu so it shows like a context menu. If the item doesn't have any sub items, then this command is ignored.
public PopupMenu ( string name, int x, int y, List subItemsToRemoveOnClose ) : void
name string The name of the item to popup. The name could be the name of /// a menu off the application's menu bar, or one of the context menu's added to the /// menu adapter.
x int The X location (on the screen) where the menu is popped-up.
y int The Y location (on the screen) where the menu is popped-up.
subItemsToRemoveOnClose List
return void

ReadCommands() protected method

Reads the commands section of a definition file.
protected ReadCommands ( XmlNode node ) : void
node System.Xml.XmlNode
return void

ReadOverJunk() protected method

Skips over white space and any other junk that's not considered an element or end element.
protected ReadOverJunk ( XmlNode node ) : XmlNode
node System.Xml.XmlNode
return System.Xml.XmlNode

ReadSingleItem() protected method

Read the information for a single menu item from the specified node.
protected ReadSingleItem ( XmlNode node, bool isMenuItem ) : DevComponents.DotNetBar.BaseItem
node System.Xml.XmlNode
isMenuItem bool
return DevComponents.DotNetBar.BaseItem

ReadSingleItem() protected method

Read the information for a single menu item from the specified node.
protected ReadSingleItem ( XmlNode node, bool isMenuItem ) : ToolStripItem
node System.Xml.XmlNode
isMenuItem bool
return System.Windows.Forms.ToolStripItem

RemoveMenuItem() public method

Removes the specified item from the specified parent menu.
Removing submenu items on a menu, while leaving the parent menu intact has not been tested (and is not currently needed).
public RemoveMenuItem ( string parentItemName, string name ) : void
parentItemName string The name of the item whose subitem will be removed. ///
name string subitem to remove from parent menu.
return void

RemoveMenuSubItems() public method

Removes all the subitems of the specified menu.
public RemoveMenuSubItems ( string parentItemName ) : void
parentItemName string The name of the item whose subitems will be removed. ///
return void

SaveBarSettings() public method

Causes the adapter to save toolbar settings (e.g. user placement of toolbars).
public SaveBarSettings ( ) : void
return void

SetBarProperties() public method

Sets the properties of the main menu bar. object.
public SetBarProperties ( SIL.FieldWorks.Common.UIAdapters.TMBarProperties barProps ) : void
barProps SIL.FieldWorks.Common.UIAdapters.TMBarProperties Properties used to modfy the toolbar item.
return void

SetBarProperties() public method

Sets properties for a menu bar or toolbar.
public SetBarProperties ( string name, SIL.FieldWorks.Common.UIAdapters.TMBarProperties barProps ) : void
name string Name of bar to update.
barProps SIL.FieldWorks.Common.UIAdapters.TMBarProperties New properties of bar.
return void

SetContextMenuForControl() public method

Sets the context menu for a specified control.
public SetContextMenuForControl ( Control ctrl, string name ) : void
ctrl System.Windows.Forms.Control Control which is being assigned a context menu.
name string The name of the context menu to assign to the control.
return void

SetItemProperties() public method

Sets some of a toolbar item's properties. Note: if the Update property in the TMItemProperties object hasn't been set to true, no updating will occur.
public SetItemProperties ( string name, SIL.FieldWorks.Common.UIAdapters.TMItemProperties itemProps ) : void
name string Name of item whose properties are being updated.
itemProps SIL.FieldWorks.Common.UIAdapters.TMItemProperties The TMItemProperties containing the new property /// values for the toolbar item.
return void

SetParentForm() public method

Sets the adapter's parent form. This will not cause docking sites to be added to the form and DotNetBar manager. This solves TE-6793
public SetParentForm ( Form newForm ) : Form
newForm System.Windows.Forms.Form The new parent form.
return System.Windows.Forms.Form

ShowCustomizeDialog() public method

Causes the adapter to show it's dialog for customizing toolbars.
public ShowCustomizeDialog ( ) : void
return void

ShowToolBar() public method

Allows an application to show a toolbar.
public ShowToolBar ( string name ) : void
name string Name of toolbar to show.
return void

m_parentForm_Shown() protected method

Locate the toolbars when their parent form is shown.
protected m_parentForm_Shown ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void

Property Details

m_allowPopupToBeCanceled protected_oe property

protected bool m_allowPopupToBeCanceled
return bool

m_allowUndocking protected_oe property

protected bool m_allowUndocking
return bool

m_allowuUpdates protected_oe property

protected bool m_allowuUpdates
return bool

m_appsRegKeyPath protected_oe property

protected RegistryKey,Microsoft.Win32 m_appsRegKeyPath
return Microsoft.Win32.RegistryKey

m_appsRegKeyPath protected_oe property

protected string m_appsRegKeyPath
return string

m_barLocations protected_oe property

protected Dictionary m_barLocations
return Point>.Dictionary

m_barReadFromSettingFile protected_oe property

protected bool m_barReadFromSettingFile
return bool

m_bars protected_oe property

protected Dictionary m_bars
return ToolStrip>.Dictionary

m_commandInfo protected_oe property

protected Dictionary m_commandInfo
return CommandInfo>.Dictionary

m_contextMenus protected_oe property

protected Dictionary m_contextMenus
return ContextMenuStrip>.Dictionary

m_customizeMenuShowing protected_oe property

protected bool m_customizeMenuShowing
return bool

m_displayedBars protected_oe property

protected Dictionary m_displayedBars
return bool>.Dictionary

m_hiddenSeparators protected_oe property

protected Dictionary m_hiddenSeparators
return ToolStripSeparator>.Dictionary

m_htBarLocations protected_oe property

protected Hashtable,System.Collections m_htBarLocations
return System.Collections.Hashtable

m_htCommandInfo protected_oe property

protected Hashtable,System.Collections m_htCommandInfo
return System.Collections.Hashtable

m_htControls protected_oe property

protected Hashtable,System.Collections m_htControls
return System.Collections.Hashtable

m_htFormTypeCommands protected_oe static_oe property

protected static Hashtable,System.Collections m_htFormTypeCommands
return System.Collections.Hashtable

m_htImages protected_oe property

protected Hashtable,System.Collections m_htImages
return System.Collections.Hashtable

m_htItemTags protected_oe property

protected Hashtable,System.Collections m_htItemTags
return System.Collections.Hashtable

m_htSettingsFileLoaded protected_oe property

protected Hashtable,System.Collections m_htSettingsFileLoaded
return System.Collections.Hashtable

m_htSystemStringIds protected_oe property

protected Hashtable,System.Collections m_htSystemStringIds
return System.Collections.Hashtable

m_htWndListIndices protected_oe property

protected Hashtable,System.Collections m_htWndListIndices
return System.Collections.Hashtable

m_images protected_oe property

protected Dictionary m_images
return Image>.Dictionary

m_itemUpdateTime protected_oe property

protected DateTime,System m_itemUpdateTime
return System.DateTime

m_menuBar protected_oe property

protected MenuStrip,System.Windows.Forms m_menuBar
return System.Windows.Forms.MenuStrip

m_menuCurrentlyPoppedUp protected_oe property

protected ButtonItem,DevComponents.DotNetBar m_menuCurrentlyPoppedUp
return DevComponents.DotNetBar.ButtonItem

m_menuCurrentlyPoppedUp protected_oe property

protected ContextMenuStrip,System.Windows.Forms m_menuCurrentlyPoppedUp
return System.Windows.Forms.ContextMenuStrip

m_menusWithShortcuts protected_oe property

protected ArrayList,System.Collections m_menusWithShortcuts
return System.Collections.ArrayList

m_menusWithShortcuts protected_oe property

protected ToolStripItemCollection,System.Windows.Forms m_menusWithShortcuts
return System.Windows.Forms.ToolStripItemCollection

m_moreWindowItem protected_oe property

protected ButtonItem,DevComponents.DotNetBar m_moreWindowItem
return DevComponents.DotNetBar.ButtonItem

m_moreWindowItem protected_oe property

protected ToolStripMenuItem,System.Windows.Forms m_moreWindowItem
return System.Windows.Forms.ToolStripMenuItem

m_msgMediator protected_oe property

protected Mediator,XCore m_msgMediator
return XCore.Mediator

m_parentForm protected_oe property

protected Form,System.Windows.Forms m_parentForm
return System.Windows.Forms.Form

m_readingContextMenuDef protected_oe property

protected bool m_readingContextMenuDef
return bool

m_rmlocalMngmntStrings protected_oe property

protected ResourceManager,System.Resources m_rmlocalMngmntStrings
return System.Resources.ResourceManager

m_rmlocalStrings protected_oe property

protected ArrayList,System.Collections m_rmlocalStrings
return System.Collections.ArrayList

m_rmlocalStrings protected_oe property

protected List m_rmlocalStrings
return List

m_separators protected_oe property

protected Dictionary m_separators
return ToolStripSeparator>.Dictionary

m_settingFiles protected_oe property

protected string[] m_settingFiles
return string[]

m_settingsFilePrefix protected_oe property

protected string m_settingsFilePrefix
return string

m_tmItems protected_oe property

protected Dictionary m_tmItems
return ToolStripItem>.Dictionary

m_toolBarMenuMap protected_oe property

protected Dictionary m_toolBarMenuMap
return ToolStrip>.Dictionary

m_toolbarCustomizeItem protected_oe property

protected ButtonItem,DevComponents.DotNetBar m_toolbarCustomizeItem
return DevComponents.DotNetBar.ButtonItem

m_toolbarListItem protected_oe property

protected ButtonItem,DevComponents.DotNetBar m_toolbarListItem
return DevComponents.DotNetBar.ButtonItem

m_toolbarListItem protected_oe property

protected ToolStripMenuItem,System.Windows.Forms m_toolbarListItem
return System.Windows.Forms.ToolStripMenuItem

m_tsContainer protected_oe property

protected ToolStripContainer,System.Windows.Forms m_tsContainer
return System.Windows.Forms.ToolStripContainer

m_tsPanel protected_oe property

protected ToolStripPanel,System.Windows.Forms m_tsPanel
return System.Windows.Forms.ToolStripPanel

m_windowListItem protected_oe property

protected ButtonItem,DevComponents.DotNetBar m_windowListItem
return DevComponents.DotNetBar.ButtonItem

m_windowListItem protected_oe property

protected ToolStripMenuItem,System.Windows.Forms m_windowListItem
return System.Windows.Forms.ToolStripMenuItem

m_windowListItemClicked protected_oe property

protected ToolStripMenuItem,System.Windows.Forms m_windowListItemClicked
return System.Windows.Forms.ToolStripMenuItem

m_xmlReader protected_oe property

protected XmlTextReader,System.Xml m_xmlReader
return System.Xml.XmlTextReader