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
commit1c54ec3962c92f3f976e68c008dc7c4496413a2f (patch)
tree89fa161f8e93a5226c36878ce1afafcc8cbda7d2 /src/ExtensionsMethods.cs
parentf5608214ca3dd952e0f32cab6aebb4957cff5f3c (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)