Example #1
0
    public void CreateEventAction()
    {
        var actionsGeneric = GetParameterValue();

        List <SmartItemActionable> actions;

        if (actionsGeneric != null && (actionsGeneric is List <SmartItemActionable>))
        {
            actions = (List <SmartItemActionable>)actionsGeneric;
        }
        else
        {
            actions = new List <SmartItemActionable>();
        }

        SmartItemActionable action = new SmartItemActionable();

        action.actionableId = Guid.NewGuid().ToString();
        actions.Add(action);
        AddEventAction(action);
        SetParameterValue(actions);
    }
Example #2
0
    public void AddEventAction(SmartItemActionable action)
    {
        if (alreadyFilterList.Count <= 0)
        {
            return;
        }

        SmartItemActionEvent actionEvent = new SmartItemActionEvent();

        actionEvent.entityList          = alreadyFilterList;
        actionEvent.smartItemActionable = action;

        if (currentValues.ContainsKey(action.actionableId))
        {
            actionEvent.values = (Dictionary <object, object>)currentValues[action.actionableId];
        }
        else
        {
            actionEvent.values = new Dictionary <object, object>();
        }

        actionsListView.AddActionEventAdapter(actionEvent);
    }
Example #3
0
    private void RemoveActionable(SmartItemActionable actionable)
    {
        var actionsGeneric = GetParameterValue();

        if (actionsGeneric == null || !(actionsGeneric is List <SmartItemActionable>))
        {
            return;
        }

        SmartItemActionable        actionableToRemove = null;
        List <SmartItemActionable> actions            = (List <SmartItemActionable>)actionsGeneric;

        foreach (SmartItemActionable actionableItem in actions)
        {
            if (actionable.actionableId == actionableItem.actionableId)
            {
                actionableToRemove = actionableItem;
            }
        }
        actions.Remove(actionableToRemove);

        SetParameterValue(actions);
    }