I would like to know how I can determine whether the CultureInfo instance returned by CultureInfo.CurrentCulture has all it's default values or whether it has been customised by the user.
I have done some testing using the following LINQPad snippet and the LINQPad command line runner.
var ci = CultureInfo.CurrentCulture;
var dtf = ci.DateTimeFormat;
ci.Name.Dump("CultureInfo");
dtf.FullDateTimePattern.Dump("FullDateTimePattern");
dtf.LongDatePattern.Dump("LongDatePattern");
dtf.LongTimePattern.Dump("LongTimePattern");
I select English (South Africa) as my format in the region dialog and my snippet reports the following.
E:\Junk>lprun CurrentCulture.linq
CultureInfo: en-ZA
FullDateTimePattern: dd MMMM yyyy hh:mm:ss tt
LongDatePattern: dd MMMM yyyy
LongTimePattern: hh:mm:ss tt
Then I change the long date format to hide leading zero on the day and the long and short time to be 24 hour time. The snippet now reports this.
E:\Junk>lprun CurrentCulture.linq
CultureInfo: en-ZA
FullDateTimePattern: d MMMM yyyy HH:mm:ss
LongDatePattern: d MMMM yyyy
LongTimePattern: HH:mm:ss
Although the culture names remain the same the properties I've changed are showing me the new values.
My question is whether there is a single property or method that will tell me whether the culture returned by CurrentCulture has been changed from its default (en-ZA in this case) or not. I thought that CultureInfo.UseUserOverride might be that property but it returns true in either case.