예제 #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
        public void SingleNest()
        {
            Composer composer = new Composer();

            Object[]   objects    = { new MiddleLeft(), new BottomCenter(), new BottomLeft() };
            MiddleLeft middleLeft = composer.Compose <MiddleLeft>(objects);

            Assert.AreEqual(objects[0], middleLeft);
            Assert.AreEqual(objects[1], middleLeft.BottomCenter);
            Assert.AreEqual(objects[2], middleLeft.BottomLeft);
        }
예제 #3
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();
 }
예제 #4
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);
        }