Ejemplo n.º 1
0
 internal static bool TryKeyPrimitiveToString(object value, out string result)
 {
     if (IsBinaryValue(value))
     {
         return(TryKeyBinaryToString(value, out result));
     }
     if (value is DateTimeOffset)
     {
         value = ((DateTimeOffset)value).UtcDateTime;
     }
     else if (value is DateTimeOffset?)
     {
         value = ((DateTimeOffset?)value).Value.UtcDateTime;
     }
     return(WebConvert.TryKeyPrimitiveToString(value, out result));
 }
Ejemplo n.º 2
0
 internal static bool TryKeyBinaryToString(object binaryValue, out string result)
 {
     return(WebConvert.TryKeyPrimitiveToString((byte[])binaryValue.GetType().InvokeMember("ToArray", BindingFlags.Instance | BindingFlags.Public | BindingFlags.InvokeMethod, null, binaryValue, null, null, CultureInfo.InvariantCulture, null), out result));
 }