Ejemplo n.º 1
0
        public void Drop(DragEventArgs e, TreeNavigationItem draggedTreeNavigationItem, TreeNavigationItem targetTreeNavigationItem)
        {
            IDropHandler activeDropHandler = null;

            if (draggedTreeNavigationItem == null || targetTreeNavigationItem == null)
            {
                return;
            }
            if (draggedTreeNavigationItem.Id.Equals(targetTreeNavigationItem.Id))
            {
                return;
            }
            foreach (IDropHandler dropHandler in _dropHandlers)
            {
                if (dropHandler.IsActive(draggedTreeNavigationItem, targetTreeNavigationItem))
                {
                    activeDropHandler = dropHandler;
                    break;
                }
            }
            if (activeDropHandler != null)
            {
                activeDropHandler.Drop(draggedTreeNavigationItem, targetTreeNavigationItem);
            }
        }
    public static int OnDrop(IntPtr l)
    {
        int result;

        try
        {
            IDropHandler     dropHandler = (IDropHandler)LuaObject.checkSelf(l);
            PointerEventData eventData;
            LuaObject.checkType <PointerEventData>(l, 2, out eventData);
            dropHandler.OnDrop(eventData);
            LuaObject.pushValue(l, true);
            result = 1;
        }
        catch (Exception e)
        {
            result = LuaObject.error(l, e);
        }
        return(result);
    }
Ejemplo n.º 3
0
 private static void Execute(IDropHandler handler, BaseEventData eventData)
 {
     handler.OnDrop(ValidateEventData <PointerEventData>(eventData));
 }
Ejemplo n.º 4
0
 public static void SetDragHandler(DependencyObject obj, IDropHandler value)
 {
     obj.SetValue(DragHandlerProperty, value);
 }
        public void Add(IDropHandler handler)
        {
            Contract.Requires(handler != null);

            _handlers.Add(handler.Format, handler);
        }
Ejemplo n.º 6
0
 public static void SetDropHandler(DependencyObject obj, IDropHandler value)
 {
     obj.SetValue(DragDropHelper.DropHandlerProperty, (object) value);
 }