예제 #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));
 }
예제 #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));
 }
예제 #3
0
파일: HashAbstract.cs 프로젝트: esandre/Lib
 /// <inheritdoc />
 public override string ToString()
 => HashStringRepresentation.Process(this);