ApplicationSettings.Internal.PropertyHelper.GetFormatProvider C# (CSharp) Method

GetFormatProvider() public static method

Gtes the format provider for the property. If property contains SettingPropertyAttribute then it's SettingPropertyAttribute.CultureName is used. Otherwise CultureInfo.InvariantCulture is returned.
public static GetFormatProvider ( PropertyInfo propertyInfo ) : IFormatProvider
propertyInfo System.Reflection.PropertyInfo /// The property info. ///
return IFormatProvider
        public static IFormatProvider GetFormatProvider(PropertyInfo propertyInfo)
        {
            var attribute = propertyInfo.GetCustomAttribute<SettingPropertyAttribute>();
            if (null != attribute && null != attribute.CultureName)
            {
                return CultureInfo.GetCultureInfo(attribute.CultureName);
            }

            return CultureInfo.InvariantCulture;
        }