MonoGameUi.Control.InternalEndDrop C# (CSharp) Method

InternalEndDrop() private method

private InternalEndDrop ( DragEventArgs args ) : bool
args DragEventArgs
return bool
        internal bool InternalEndDrop(DragEventArgs args)
        {
            // Ignorieren, falls nicht im Control-Bereich
            Point size = ActualSize;
            if (args.LocalPosition.X < 0 || args.LocalPosition.X >= size.X ||
                args.LocalPosition.Y < 0 || args.LocalPosition.Y >= size.Y)
                return false;

            // Ignorieren, falls nicht gehovered
            if (!Visible) return false;

            // Ignorieren, falls ausgeschaltet
            if (!Enabled) return true;

            // Children first (Order by Z-Order)
            foreach (var child in Children.InZOrder())
            {
                args.LocalPosition = CalculateLocalPosition(args.GlobalPosition, child);
                args.Bubbled = child.InternalEndDrop(args) || args.Bubbled;
                if (args.Handled) break;
            }

            // Bubble up
            if (!args.Handled)
            {
                args.LocalPosition = CalculateLocalPosition(args.GlobalPosition, this);
                OnEndDrop(args);
                if (EndDrop != null)
                    EndDrop(args);
            }

            // Leave
            if (dropHovered)
            {
                OnDropLeave(args);
                if (DropLeave != null)
                    DropLeave(args);
                dropHovered = false;
            }

            return Background != null;
        }