Пример #1
0
 /// <inheritdoc />
 public override int GetHashCode()
 => GetHashCodeHelper.CalculateHashCode(TopLeft.GetHashCode(),
                                        TopMiddle.GetHashCode(),
                                        TopRight.GetHashCode(),
                                        MiddleLeft.GetHashCode(),
                                        MiddleRight.GetHashCode(),
                                        BottomLeft.GetHashCode(),
                                        BottomMiddle.GetHashCode(),
                                        BottomRight.GetHashCode());
Пример #2
0
 /// <summary>
 /// Destroy this <see cref="Texture2D"/>.
 /// </summary>
 public void Dispose()
 {
     TopLeft.Dispose();
     TopCenter.Dispose();
     TopRight.Dispose();
     MiddleLeft.Dispose();
     MiddleCenter.Dispose();
     MiddleRight.Dispose();
     BottomLeft.Dispose();
     BottomCenter.Dispose();
     BottomRight.Dispose();
 }
Пример #3
0
        public override UIElement OnMouseAction(MouseActionEventArgs mouse)
        {
            UIElement intercept = base.OnMouseAction(mouse);

            if (intercept == null && FrameDimensions.Contains(mouse.Position))
            {
                intercept = this;

                if (ResizeableByUser && mouse.Button == MouseButton.Left && mouse.Action == MouseAction.Pressed)
                {
                    if (TopLeft.Contains(mouse.Position))
                    {
                        EdgeCaught = Edge.TopLeft;
                    }
                    else if (Top.Contains(mouse.Position))
                    {
                        EdgeCaught = Edge.Top;
                    }
                    else if (TopRight.Contains(mouse.Position))
                    {
                        EdgeCaught = Edge.TopRight;
                    }
                    else if (MiddleLeft.Contains(mouse.Position))
                    {
                        EdgeCaught = Edge.Left;
                    }
                    else if (MiddleRight.Contains(mouse.Position))
                    {
                        EdgeCaught = Edge.Right;
                    }
                    else if (BottomLeft.Contains(mouse.Position))
                    {
                        EdgeCaught = Edge.BottomLeft;
                    }
                    else if (Bottom.Contains(mouse.Position))
                    {
                        EdgeCaught = Edge.Bottom;
                    }
                    else if (BottomRight.Contains(mouse.Position))
                    {
                        EdgeCaught = Edge.BottomRight;
                    }
                }
            }

            if (mouse.Button == MouseButton.Left && mouse.Action == MouseAction.Released)
            {
                EdgeCaught = Edge.None;
            }

            return(intercept);
        }