public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { if (value is TValue tValue) { return(ValueOf <TValue, TThis> .From(tValue)); } if (value is DateTime date && typeof(TValue) == typeof(string) && date.ToString("o") is TValue stringValue) { return(ValueOf <TValue, TThis> .From(stringValue)); } return(base.ConvertFrom(context, culture, value)); }
protected virtual bool Equals(ValueOf <TValue, TThis> other) { return(EqualityComparer <TValue> .Default.Equals(this.Value, other.Value)); }
protected override bool Equals(ValueOf <string, TThis> other) { return(EqualityComparer <string> .Default.Equals(this.Value.ToLowerInvariant(), other.Value.ToLowerInvariant())); }