public override void OnBuiltUp(string id)
        {
            base.OnBuiltUp(id);

            packStationOverviewRunPackRowForPackStation += "/" + id;
            ActionCatalog.RegisterActionImplementation(packStationOverviewRunPackRowForPackStation, OnPackStationOverviewRunPackRowForPackStation);
            //ActionCatalog.RegisterSpecificCondition(packStationFromLcEditRunPackRowForPackStation, new PackStationFromLcEditRunPackRowForPackStationCondition());
        }
Beispiel #2
0
        // Called when action list is to be updated on screen
        public void ShowActions(string actionString)
        {
            //System.Diagnostics.Debug.WriteLine("Entering ShowActions on Dialog " + View.Id + ",    " + actionString);

            ICollection <ShellAction> serviceActions = ShellInteractionService.Actions;

            // remove old Action data
            ICollection <ShellAction> tempActions = new List <ShellAction>();;

            foreach (ShellAction shellAction in serviceActions)
            {
                tempActions.Add(shellAction);
            }

            foreach (ShellAction shellAction in tempActions)
            {
                ActionCatalog.RemoveActionImplementation(shellAction.Id);
                serviceActions.Remove(shellAction);
            }
            actions.Clear();
            if (actionString.Length == 0)
            {
                return;
            }

            // decode actionString and add new Actions
            char[]      delimiter    = { ';' };
            string[]    actionsArray = actionString.Split(delimiter);
            ShellAction action;

            for (int i = 0; i < actionsArray.Length - 1; i = i + 2)
            {
                action              = new ShellAction(workItem);
                action.Id           = (string)actionsArray.GetValue(i) + Separator + View.Id; // make sure Id is unique!
                action.Caption      = (string)actionsArray.GetValue(i + 1);
                action.IsAuthorized = true;
                action.IsEnabled    = true;
                action.Parameters   = action.Id;
                actions.Add(action);

                ActionCatalog.RegisterActionImplementation(action.Id, OnAction);
                serviceActions.Add(action);
                //System.Diagnostics.Debug.WriteLine("action " + action.Caption + " was added");
            }
        }