Esempio n. 1
0
 /// <inheritdoc />
 public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
 {
     if (destinationType == typeof(string) && value is IHash hash)
     {
         return(HashStringRepresentation.Process(hash));
     }
     return(base.ConvertTo(context, culture, value, destinationType));
 }
Esempio n. 2
0
 /// <inheritdoc />
 public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
 {
     return(value is string inputString
         ? HashStringRepresentation.Retrieve(inputString)
         : base.ConvertFrom(context, culture, value));
 }
Esempio n. 3
0
 /// <inheritdoc />
 public override string ToString()
 => HashStringRepresentation.Process(this);