ログインしている各ユーザーについて知り、CurrentCulture
その文化に基づいてユーザーごとに設定を行うのに最適な場所はどこですか?
静的コンストラクターを使用して静的プロパティを割り当てることはできますか?
こんなことできるのか!!
public class MetricSystemHelper
{
private static bool _isMetric;
static MetricSystemHelper()
{
RegionInfo region = new RegionInfo(System.Threading.Thread.CurrentThread.CurrentCulture.Name);
if (true == region.IsMetric)
{
_isMetric = true;
}
else // USA, Liberia, Myanmar(Only these countries doesn't use metric)
{
_isMetric = false;
};
}
public static bool IsMetric
{
get
{
return _isMetric;
}
}