3 namespace Tizen.NUI.XamlBinding
5 internal static class EffectiveFlowDirectionExtensions
7 internal static EffectiveFlowDirection ToEffectiveFlowDirection(this FlowDirection self, bool isExplicit = false)
11 case FlowDirection.MatchParent:
12 return default(EffectiveFlowDirection);
15 case FlowDirection.LeftToRight:
18 return EffectiveFlowDirection.Explicit;
22 return default(EffectiveFlowDirection);
25 case FlowDirection.RightToLeft:
28 return EffectiveFlowDirection.RightToLeft | EffectiveFlowDirection.Explicit;
32 return EffectiveFlowDirection.RightToLeft;
36 throw new InvalidOperationException($"Cannot convert {self} to {nameof(EffectiveFlowDirection)}.");
40 internal static FlowDirection ToFlowDirection(this EffectiveFlowDirection self)
42 if (self.IsLeftToRight())
43 return FlowDirection.LeftToRight;
45 return FlowDirection.RightToLeft;
47 throw new InvalidOperationException($"Cannot convert {self} to {nameof(FlowDirection)}.");
50 public static bool IsRightToLeft(this EffectiveFlowDirection self)
52 return (self & EffectiveFlowDirection.RightToLeft) == EffectiveFlowDirection.RightToLeft;
55 public static bool IsLeftToRight(this EffectiveFlowDirection self)
57 return (self & EffectiveFlowDirection.RightToLeft) != EffectiveFlowDirection.RightToLeft;
60 public static bool IsImplicit(this EffectiveFlowDirection self)
62 return (self & EffectiveFlowDirection.Explicit) != EffectiveFlowDirection.Explicit;
65 public static bool IsExplicit(this EffectiveFlowDirection self)
67 return (self & EffectiveFlowDirection.Explicit) == EffectiveFlowDirection.Explicit;