2 using System.ComponentModel;
3 using Tizen.NUI.Binding;
5 namespace Tizen.NUI.Binding
7 [EditorBrowsable(EditorBrowsableState.Never)]
8 internal static class EffectiveFlowDirectionExtensions
10 internal static EffectiveFlowDirection ToEffectiveFlowDirection(this FlowDirection self, bool isExplicit = false)
14 case FlowDirection.MatchParent:
15 return default(EffectiveFlowDirection);
18 case FlowDirection.LeftToRight:
21 return EffectiveFlowDirection.Explicit;
25 return default(EffectiveFlowDirection);
28 case FlowDirection.RightToLeft:
31 return EffectiveFlowDirection.RightToLeft | EffectiveFlowDirection.Explicit;
35 return EffectiveFlowDirection.RightToLeft;
39 throw new InvalidOperationException($"Cannot convert {self} to {nameof(EffectiveFlowDirection)}.");
43 internal static FlowDirection ToFlowDirection(this EffectiveFlowDirection self)
45 if (self.IsLeftToRight())
46 return FlowDirection.LeftToRight;
48 return FlowDirection.RightToLeft;
50 throw new InvalidOperationException($"Cannot convert {self} to {nameof(FlowDirection)}.");
53 public static bool IsRightToLeft(this EffectiveFlowDirection self)
55 return (self & EffectiveFlowDirection.RightToLeft) == EffectiveFlowDirection.RightToLeft;
58 public static bool IsLeftToRight(this EffectiveFlowDirection self)
60 return (self & EffectiveFlowDirection.RightToLeft) != EffectiveFlowDirection.RightToLeft;
63 public static bool IsImplicit(this EffectiveFlowDirection self)
65 return (self & EffectiveFlowDirection.Explicit) != EffectiveFlowDirection.Explicit;
68 public static bool IsExplicit(this EffectiveFlowDirection self)
70 return (self & EffectiveFlowDirection.Explicit) == EffectiveFlowDirection.Explicit;