protected internal virtual ProviderPropertyList GetProperties() { ProviderPropertyList providerPropertyList = new ProviderPropertyList(); PropertyInfo[] properties = base.GetType().GetProperties(); for (int i = 0; i < properties.Length; i++) { PropertyInfo propertyInfo = properties[i]; if (propertyInfo.CanRead && propertyInfo.CanWrite && !(propertyInfo.DeclaringType == typeof(Provider))) { TypeConverter converter = TypeDescriptor.GetConverter(propertyInfo.PropertyType); if (converter != null && converter.CanConvertTo(typeof(string)) && converter.CanConvertFrom(typeof(string))) { object value = propertyInfo.GetValue(this, null); providerPropertyList.SetValue(propertyInfo.Name, converter.ConvertToInvariantString(value)); } } } return(providerPropertyList); }
protected internal virtual void SetProperties(ProviderPropertyList properties) { PropertyInfo[] properties2 = base.GetType().GetProperties(); for (int i = 0; i < properties2.Length; i++) { PropertyInfo propertyInfo = properties2[i]; if (propertyInfo.CanRead && propertyInfo.CanWrite) { TypeConverter converter = TypeDescriptor.GetConverter(propertyInfo.PropertyType); if (converter != null && converter.CanConvertFrom(typeof(string))) { string stringValue = properties.GetStringValue(propertyInfo.Name, null); if (stringValue != null && converter.IsValid(stringValue)) { propertyInfo.SetValue(this, converter.ConvertFromInvariantString(stringValue), null); } } } } }
public ProviderSettings(int providerId, int instanceId) { this.ProviderId = providerId; this.InstanceId = instanceId; this.Properties = new ProviderPropertyList(); }
internal ProviderPropertyList(ProviderPropertyList list) { this.dictionary = new Dictionary <string, string>(list.dictionary); }