From 6f303fb67fcc7843ed564c676d12e86b034cfe0a Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bruyère Date: Wed, 7 Mar 2018 15:06:30 +0100 Subject: Height and Width of GO major change for stacking, docker improvement and simplification --- src/ExtensionsMethods.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/ExtensionsMethods.cs') diff --git a/src/ExtensionsMethods.cs b/src/ExtensionsMethods.cs index dfb90f0e..d7448874 100644 --- a/src/ExtensionsMethods.cs +++ b/src/ExtensionsMethods.cs @@ -109,6 +109,27 @@ namespace Crow public static Orientation GetOrientation(this Alignment a){ return (a==Alignment.Left) ||(a==Alignment.Right) ? Orientation.Horizontal : Orientation.Vertical; } + public static Alignment GetOpposite(this Alignment a){ + switch (a) { + case Alignment.Left: + return Alignment.Right; + case Alignment.Right: + return Alignment.Left; + case Alignment.Top: + return Alignment.Bottom; + case Alignment.Bottom: + return Alignment.Top; + case Alignment.TopLeft: + return Alignment.BottomRight; + case Alignment.TopRight: + return Alignment.BottomLeft; + case Alignment.BottomLeft: + return Alignment.TopRight; + case Alignment.BottomRight: + return Alignment.TopLeft; + } + return Alignment.Center; + } public static void Raise(this EventHandler handler, object sender, EventArgs e) { if(handler != null) -- cgit v1.3.1-4-g156e