/// <summary> /// /// </summary> /// <param name="contextID">active/target context (irelevant for RC)</param> /// <param name="osCommandMenuEntry"></param> /// <param name="lastFocusedCtrlTask"> ///the task of the last focused control. This is required because even if there is no ///last focused control, then also we have task and hence expression/function will be executed properly. ///Previously task was obtained from the control and when there was no control,task could not be obtained. /// </param> /// <returns></returns> internal static void onOSMenuSelection(Int64 contextID, MenuEntryOSCommand osCommandMenuEntry, MgForm activeForm) { Task lastFocusedCtrlTask = getLastFocusedTask(activeForm); RunTimeEvent osMenuEvent = new RunTimeEvent(osCommandMenuEntry, lastFocusedCtrlTask); if (osCommandMenuEntry.Wait) { ClientManager.Instance.EventsManager.handleEvent(osMenuEvent, false); } else { ClientManager.Instance.EventsManager.addToTail(osMenuEvent); } }
/// <summary> /// Handles menu selection /// </summary> /// <param name="contextID">active/target context (irelevant for RC)</param> /// <param name = "menuEntry"></param> /// <param name = "activeForm"></param> /// <param name = "activatedFromMDIFrame"></param> private void OnMenuOSCommandSelection(Int64 contextID, MenuEntryOSCommand osCommandMenuEntry, GuiMgForm activeForm) { MenuManager.onOSMenuSelection(contextID, osCommandMenuEntry, (MgForm)activeForm); }
/// <summary> /// Create an Event for the passed os menu entry /// </summary> /// <param name = "osCommand">the selected os command menu entry</param> /// <param name = "currentTask">the task from which the menu was activated</param> internal RunTimeEvent(MenuEntryOSCommand osCommand, Task currentTask) : base(osCommand) { _task = currentTask; }