Beispiel #1
0
        /// <summary>
        ///   This method is activated when an Event menu was selected. It performs the needed operations in order to
        ///   translate the selected event menu into the matching operation
        /// </summary>
        /// <param name = "menuEntryEvent">the selected menu \ bar menuEntryEvent object</param>
        /// <param name = "activeForm">last active Form</param>
        /// <param name = "ctlIdx">the index of the ctl which the menu is attached to in toolkit</param>
        internal static void onEventMenuSelection(MenuEntryEvent menuEntryEvent, MgForm activeForm, int ctlIdx)
        {
            MgControl lastFocusedControl = getLastFocusedControl(activeForm);
            Task      task = getLastFocusedTask(activeForm);

            RunTimeEvent aRtEvt = new RunTimeEvent(menuEntryEvent, task, lastFocusedControl, ctlIdx);

            aRtEvt.setPublicName();
            aRtEvt.setMainPrgCreator(null);

            // build the argument list from the mainProgVars
            List <String> mainProgVars = menuEntryEvent.MainProgVars;

            if (mainProgVars != null && mainProgVars.Count > 0)
            {
                ArgumentsList argList = new ArgumentsList();
                argList.fillListByMainProgVars(mainProgVars, task.getCtlIdx());
                aRtEvt.setArgList(argList);
                aRtEvt.setTask(null);
            }

            ClientManager.Instance.EventsManager.addToTail(aRtEvt);
        }