ToBool() public static method

public static ToBool ( string text ) : bool
text string
return bool
示例#1
0
 public static bool ToBool(this IWoopsaValue value)
 {
     if (value.Type == WoopsaValueType.Logical)
     {
         return(WoopsaFormat.ToBool(value.AsText));
     }
     else
     {
         throw new WoopsaException(WoopsaExceptionMessage.WoopsaCastTypeMessage("bool", value.Type.ToString()));
     }
 }
示例#2
0
 public static bool ToBool(this WoopsaJsonData data)
 {
     if (data.IsSimple)
     {
         return(WoopsaFormat.ToBool(WoopsaFormat.ToStringWoopsa(data.InternalObject)));
     }
     else
     {
         throw new WoopsaException(WoopsaExceptionMessage.WoopsaCastTypeMessage("bool", data.InternalObject.GetType().ToString()));
     }
 }