3

In a .NET application, it seems you can get or set the current (UI) culture via

System.Threading.Thread.CurrentThread.CurrentUICulture

or via

System.Globalization.CultureInfo.CurrentUICulture

Is one to be preferred over the other? Or is CultureInfo.CurrentUICulture just reading from Thread.CurrentThread.CurrentUICulture?

Peter
  • 13,733
  • 11
  • 75
  • 122
  • You might find it instructive to look at the [reference source](http://referencesource.microsoft.com/#mscorlib/system/globalization/cultureinfo.cs). – Damien_The_Unbeliever Aug 14 '14 at 09:43
  • Or even the [documentation](http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.currentuiculture(v=vs.110).aspx): "This read-only property is equivalent to retrieving the `CultureInfo` object returned by the `System.Threading.Thread.CurrentThread.CurrentUICulture` property" – Damien_The_Unbeliever Aug 14 '14 at 09:47
  • Ok, I was too fast with my question. My apologies. Thanks for pointing this out. – Peter Aug 14 '14 at 09:59

1 Answers1

1

According to the MSDN entry for CultureInfo.CurrentUICulture:

This read-only property is equivalent to retrieving the CultureInfo object returned by the System.Threading.Thread.CurrentThread.CurrentUICulture property.

so the answer to your second question is definitely yes.

Seeing as they are essentially the same thing, I believe that the choice between them comes down to personal preference, no more.

andreea
  • 86
  • 1
  • 8