aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/ExtensionsMethods.cs
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-03-07 15:06:30 +0100
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-03-07 15:06:30 +0100
commit6f303fb67fcc7843ed564c676d12e86b034cfe0a (patch)
tree01832b4b99c0dbcdbdb1743f073dd93e6f975149 /src/ExtensionsMethods.cs
parent5f98acc7dac6255fceb81da2b8f7e37ffcbec1e8 (diff)
Height and Width of GO major change for stacking, docker improvement and simplification
Diffstat (limited to 'src/ExtensionsMethods.cs')
-rw-r--r--src/ExtensionsMethods.cs21
1 files changed, 21 insertions, 0 deletions
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)