private void DropTarget(string str, Point mouse)
        {
            SmartEvent  el     = events.EventAt(mouse.X, mouse.Y);
            SmartAction action = (SmartAction)el.GetElementFromPos(mouse.X, mouse.Y);
            SmartTarget target = SmartFactory.GetInstance().TargetFactory(str);

            target.UpdateParams(action.Target);
            action.Target = target;
        }
Exemple #2
0
        private DropResult TargetDropResult(int x, int y)
        {
            SmartEvent ev = EventAt(x, y);

            if (ev != null)
            {
                DrawableElement dr = ev.GetElementFromPos(x, y);
                if (dr != null)
                {
                    return(DropResult.REPLACE);
                }
            }
            return(DropResult.NONE);
        }
        private void DropAction(string str, Point mouse)
        {
            SmartEvent el = events.EventAt(mouse.X, mouse.Y);

            switch (dropResult)
            {
            case DropResult.INSERT:
                el.InsertAction(SmartFactory.GetInstance().ActionFactory(str), el.GetInsertActionIndexFromPos(mouse.X, mouse.Y));
                break;

            case DropResult.REPLACE:
                SmartAction action = (SmartAction)el.GetElementFromPos(mouse.X, mouse.Y);
                el.ReplaceAction(SmartFactory.GetInstance().ActionFactory(str), action);
                break;
            }
        }
        private void DropCondition(string str, Point mouse)
        {
            SmartEvent el = events.EventAt(mouse.X, mouse.Y);

            switch (dropResult)
            {
            case DropResult.INSERT:
                el.InsertCondition(SmartFactory.GetInstance().ConditionFactory(str), el.GetInsertConditionIndexFromPos(mouse.X, mouse.Y));
                break;

            case DropResult.REPLACE:
                DrawableElement condition = el.GetElementFromPos(mouse.X, mouse.Y);
                el.ReplaceCondition(SmartFactory.GetInstance().ConditionFactory(str), (SmartCondition)condition);
                break;
            }
        }