Exemplo n.º 1
0
 public bool toBool()
 {
     if (null != obj && obj.GetType() == typeof(string))
     {
         return(bool.Parse(obj.ToString()));
     }
     return(JSONTools.ReadBool(obj));
 }
Exemplo n.º 2
0
    public static bool ReadBool(Dictionary <string, object> inDict, string inBoolName, bool inDefaultValue = false)
    {
        bool returnVal = inDefaultValue;

        if (inDict.ContainsKey(inBoolName) == true)
        {
            returnVal = (bool)JSONTools.ReadBool(inDict[inBoolName]);
        }

        return(returnVal);
    }