/// <summary> /// Sets the value of this property. /// </summary> public virtual void SetValue(object value) { var context = new SimpleTypeDescriptorContext { Instance = this.Settings, ServiceProvider = GetServiceProvider() }; this.Settings.Value = this.ValueConverter.Value.CanConvertTo(context, typeof(string)) ? this.ValueConverter.Value.ConvertToString(context, value) : string.Empty; }
/// <summary> /// Gets the value of the property. /// </summary> public virtual object GetValue() { var context = new SimpleTypeDescriptorContext { Instance = this.Settings, ServiceProvider = GetServiceProvider() }; if (this.Settings.HasValue()) { return this.ValueConverter.Value.CanConvertFrom(context, typeof(string)) ? this.ValueConverter.Value.ConvertFromString(context, this.Settings.Value) : string.Empty; } else { return string.Empty; } }