void IDynamicCommandMenuContext.CommandExecuted(IMenuCommandObject menuCommandObject) { // get reference to underlying command object SwitchWeblogMenuCommand menuCommand = menuCommandObject as SwitchWeblogMenuCommand; // fire notification to listeners if (WeblogSelected != null) { WeblogSelected(menuCommand.BlogId); } }
public DynamicCommandMenuOverflowForm(IMenuCommandObject[] menuCommandObjects) { // // Required for Windows Form Designer support // InitializeComponent(); this.buttonOK.Text = Res.Get(StringId.OKButtonText); this.buttonCancel.Text = Res.Get(StringId.CancelButton); // initialize the listbox foreach (IMenuCommandObject menuCommandObject in menuCommandObjects) listBoxCommands.Items.Add(new MenuCommandObjectListBoxAdapter(menuCommandObject)); // select the top item in the list box if (listBoxCommands.Items.Count > 0) listBoxCommands.SelectedIndex = 0; }
public MenuCommandObjectListBoxAdapter(IMenuCommandObject menuCommandObject) { _menuCommandObject = menuCommandObject; }
public MenuCommandObjectListBoxAdapter(IMenuCommandObject menuCommandObject) { _menuCommandObject = menuCommandObject; }
public void CommandExecuted(IMenuCommandObject menuCommandObject) { (menuCommandObject as ContentSourceCommand).PerformExecute(); }