开发者

Find the flow direction from CurrentCulture in c#

开发者 https://www.devze.com 2023-02-06 08:22 出处:网络
HI Is there any way to get the FlowDirection for current culture. I have set a property like public string FlowDirection

HI Is there any way to get the FlowDirection for current culture.

I have set a property like

public string FlowDirection
{
get {
return // should return the flow direction using Thread.CurrentThread.CurrentUICulture.
}
}

I dont want to hardcode something like

if (currentLanguage.ToLower().StartsWith("ar"))
{
  开发者_如何学C   return FlowDirection.RightToLeft;
}
else
{
    return FlowDirection.LeftToRight;
}


use this: CultureInfo.TextInfo.IsRightToLeft

taken from related question

0

精彩评论

暂无评论...
验证码 换一张
取 消