Reputation: 256999
i am converting strings to values using a culture specified to me as a IFormatProvider
.
i am trying to figure out which culture they gave me.
i realize that IFormatProvider
doesn't necessarily have to correspond to a System.Globalization.Culture
, but it did.
So how can i get its name?
Upvotes: 2
Views: 1997
Reputation: 1039348
The CultureInfo
class implements IFormatProvider
so you may try casting:
IFormatProvider provider = ...
CultureInfo ci = provider as CultureInfo;
if (ci != null)
{
string name = ci.DisplayName;
...
}
Upvotes: 6