Exemplo n.º 1
0
        public override bool duplicateElement(DataControl dataControl)
        {
            if (!(dataControl is ActionDataControl))
            {
                return(false);
            }


            Action            newElement;
            ActionDataControl adc;

            if (((Action)(dataControl.getContent())).getType() == Action.CUSTOM || ((Action)(dataControl.getContent())).getType() == Action.CUSTOM_INTERACT)
            {
                newElement = (CustomAction)(((CustomAction)(dataControl.getContent())).Clone());
                adc        = new CustomActionDataControl((CustomAction)newElement);
            }
            else
            {
                newElement = (Action)(((Action)(dataControl.getContent())).Clone());
                adc        = new ActionDataControl(newElement);
            }
            actionsList.Add(newElement);
            actionsDataControlList.Add(adc);
            return(true);
        }
Exemplo n.º 2
0
        public override bool moveElementDown(DataControl dataControl)
        {
            bool elementMoved = false;
            int  elementIndex = actionsList.IndexOf((Action)dataControl.getContent());

            if (elementIndex < actionsList.Count - 1)
            {
                Action            e = actionsList[elementIndex];
                ActionDataControl c = actionsDataControlList[elementIndex];
                actionsList.RemoveAt(elementIndex);
                actionsDataControlList.RemoveAt(elementIndex);
                actionsList.Insert(elementIndex + 1, e);
                actionsDataControlList.Insert(elementIndex + 1, c);
                controller.DataModified();
                elementMoved = true;
            }

            return(elementMoved);
        }