System.Configuration.ConfigurationProperty.ConvertFromString C# (CSharp) Метод

ConvertFromString() приватный Метод

private ConvertFromString ( string value ) : Object
value string
Результат Object
        internal Object ConvertFromString(string value) {
            object result = null;

            try {
                result = Converter.ConvertFromInvariantString(value);
            }
            catch (Exception ex) {
                throw new ConfigurationErrorsException(SR.GetString(SR.Top_level_conversion_error_from_string, _name, ex.Message));
            }
            catch {
                throw new ConfigurationErrorsException(SR.GetString(SR.Top_level_conversion_error_from_string, _name, ExceptionUtil.NoExceptionInformation));
            }

            return result;
        }

Usage Example

Пример #1
0
 internal void SetStringValue(string value)
 {
     val = property.ConvertFromString(value);
     if (!object.Equals(val, DefaultValue))
     {
         origin = PropertyValueOrigin.SetHere;
     }
 }
All Usage Examples Of System.Configuration.ConfigurationProperty::ConvertFromString