C# Class XCore.MenuAdapter

Creates the menu bar and menus for an XCore application.
Inheritance: XCore.BarAdapterBase, IUIMenuAdapter, ITestableUIAdapter
Datei anzeigen Open project: sillsdev/FieldWorks

Public Methods

Method Description
ClickOnEverything ( ) : void
HandleAltKey ( System e, bool wasDown ) : bool
Init ( System window, IImageCollection smallImages, IImageCollection largeImages, XCore.Mediator mediator ) : Control
MenuAdapter ( ) : System

Initializes a new instance of the MenuAdapter class.

OnClick ( object something, System args ) : void
OnIdle ( ) : void

we use the idle call here to update the enabled/disabled state of the buttons

PersistLayout ( ) : void

store the location/settings of various widgets so that we can restore them next time

ShowContextMenu ( XCore.ChoiceGroup group, Point location, XCore.TemporaryColleagueParameter temporaryColleagueParam, XCore.MessageSequencer sequencer ) : void
ShowContextMenu ( XCore.ChoiceGroup @group, Point location, XCore.TemporaryColleagueParameter temporaryColleagueParam, XCore.MessageSequencer sequencer, Action adjustMenu ) : void

Protected Methods

Method Description
ClickOnAllItems ( System.Windows.Forms.CommandBarMenu menu ) : void
Dispose ( bool fDisposing ) : void
GetMenu ( string groupId ) : System.Windows.Forms.CommandBarMenu
GetMenuItem ( System.Windows.Forms.CommandBarMenu menu, string id ) : CommandBarItem
MakeMenu ( CommandBar parent, XCore.ChoiceGroup group ) : CommandBarItem

Private Methods

Method Description
ClickItem ( string groupId, string itemId ) : void
CreateContextMenuUIForChoiceGroup ( XCore.ChoiceGroup group ) : void
CreateMenuItem ( XCore.ChoiceBase choice ) : CommandBarItem
CreateUIForChoiceGroup ( XCore.ChoiceGroup group ) : void
CreateUIForChoiceGroupCollection ( XCore.ChoiceGroupCollection groupCollection ) : void
GetItemCountOfGroup ( string groupId ) : int
HasItem ( string groupId, string itemId ) : bool
IsItemEnabled ( string groupId, string itemId ) : bool

Method Details

ClickOnAllItems() protected method

protected ClickOnAllItems ( System.Windows.Forms.CommandBarMenu menu ) : void
menu System.Windows.Forms.CommandBarMenu
return void

ClickOnEverything() public method

public ClickOnEverything ( ) : void
return void

Dispose() protected method

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

GetMenu() protected method

protected GetMenu ( string groupId ) : System.Windows.Forms.CommandBarMenu
groupId string
return System.Windows.Forms.CommandBarMenu

GetMenuItem() protected method

protected GetMenuItem ( System.Windows.Forms.CommandBarMenu menu, string id ) : CommandBarItem
menu System.Windows.Forms.CommandBarMenu
id string
return System.Windows.Forms.CommandBarItem

HandleAltKey() public method

public HandleAltKey ( System e, bool wasDown ) : bool
e System
wasDown bool
return bool

Init() public method

public Init ( System window, IImageCollection smallImages, IImageCollection largeImages, XCore.Mediator mediator ) : Control
window System
smallImages IImageCollection
largeImages IImageCollection
mediator XCore.Mediator
return System.Windows.Forms.Control

MakeMenu() protected method

protected MakeMenu ( CommandBar parent, XCore.ChoiceGroup group ) : CommandBarItem
parent System.Windows.Forms.CommandBar
group XCore.ChoiceGroup
return System.Windows.Forms.CommandBarItem

MenuAdapter() public method

Initializes a new instance of the MenuAdapter class.
public MenuAdapter ( ) : System
return System

OnClick() public method

public OnClick ( object something, System args ) : void
something object
args System
return void

OnIdle() public method

we use the idle call here to update the enabled/disabled state of the buttons
public OnIdle ( ) : void
return void

PersistLayout() public method

store the location/settings of various widgets so that we can restore them next time
public PersistLayout ( ) : void
return void

ShowContextMenu() public method

public ShowContextMenu ( XCore.ChoiceGroup group, Point location, XCore.TemporaryColleagueParameter temporaryColleagueParam, XCore.MessageSequencer sequencer ) : void
group XCore.ChoiceGroup
location Point
temporaryColleagueParam XCore.TemporaryColleagueParameter
sequencer XCore.MessageSequencer
return void

ShowContextMenu() public method

public ShowContextMenu ( XCore.ChoiceGroup @group, Point location, XCore.TemporaryColleagueParameter temporaryColleagueParam, XCore.MessageSequencer sequencer, Action adjustMenu ) : void
@group XCore.ChoiceGroup
location Point
temporaryColleagueParam XCore.TemporaryColleagueParameter
sequencer XCore.MessageSequencer
adjustMenu Action
return void