/// <inheritdoc /> public override int GetHashCode() => GetHashCodeHelper.CalculateHashCode(TopLeft.GetHashCode(), TopMiddle.GetHashCode(), TopRight.GetHashCode(), MiddleLeft.GetHashCode(), MiddleRight.GetHashCode(), BottomLeft.GetHashCode(), BottomMiddle.GetHashCode(), BottomRight.GetHashCode());
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); }
/// <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(); }
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); }