C# Class ApplicationSettings.Internal.PropertyHelper

Helper methods for accessing property information.
Mostra file Open project: tparvi/appsettings

Public Methods

Method Description
CanReadFrom ( PropertyInfo propertyInfo ) : bool
CanWriteInto ( PropertyInfo propertyInfo ) : bool

Checks if property can be written into. If the property is read only or it is ignored then we cannot write into it.

GetFormatProvider ( PropertyInfo propertyInfo ) : IFormatProvider

Gtes the format provider for the property. If property contains SettingPropertyAttribute then it's SettingPropertyAttribute.CultureName is used. Otherwise CultureInfo.InvariantCulture is returned.

GetPropertyValue ( object instance, PropertyInfo propertyInfo, IFormatProvider formatProvider ) : string

Gets the value of the property.

GetSettingName ( PropertyInfo propertyInfo ) : string

Gets the name of the setting for the property. If property contains SettingPropertyAttribute then it is used. Otherwise property's name is returned.

IsConnectionString ( PropertyInfo propertyInfo ) : bool

Checks if the property is actually defined as connection string.

Method Details

CanReadFrom() public static method

public static CanReadFrom ( PropertyInfo propertyInfo ) : bool
propertyInfo System.Reflection.PropertyInfo
return bool

CanWriteInto() public static method

Checks if property can be written into. If the property is read only or it is ignored then we cannot write into it.
public static CanWriteInto ( PropertyInfo propertyInfo ) : bool
propertyInfo System.Reflection.PropertyInfo /// The property info. ///
return bool

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

GetPropertyValue() public static method

Gets the value of the property.
public static GetPropertyValue ( object instance, PropertyInfo propertyInfo, IFormatProvider formatProvider ) : string
instance object Object from which the property is returned.
propertyInfo System.Reflection.PropertyInfo The property.
formatProvider IFormatProvider Format provider.
return string

GetSettingName() public static method

Gets the name of the setting for the property. If property contains SettingPropertyAttribute then it is used. Otherwise property's name is returned.
public static GetSettingName ( PropertyInfo propertyInfo ) : string
propertyInfo System.Reflection.PropertyInfo /// The property info. ///
return string

IsConnectionString() public static method

Checks if the property is actually defined as connection string.
public static IsConnectionString ( PropertyInfo propertyInfo ) : bool
propertyInfo System.Reflection.PropertyInfo The property info.
return bool