MonoGameUi.Control.InternalLeftMouseClick C# (CSharp) Method

InternalLeftMouseClick() private method

private InternalLeftMouseClick ( MouseEventArgs args ) : bool
args MouseEventArgs
return bool
        internal bool InternalLeftMouseClick(MouseEventArgs 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.InternalLeftMouseClick(args) || args.Bubbled;
                if (args.Handled) break;
            }

            // Lokales Events
            if (!args.Handled)
            {
                args.LocalPosition = CalculateLocalPosition(args.GlobalPosition, this);
                OnLeftMouseClick(args);
                if (LeftMouseClick != null)
                    LeftMouseClick(this, args);
            }

            // Click-Sound abspielen
            if (clickSound != null)
                clickSound.Play();

            return Background != null;
        }