示例#1
0
        bool getbalance()
        {
            string         response   = Client.GetStringAsync("user").Result;
            WDUserResponse tmpBalance = json.JsonDeserialize <WDUserResponse>(response);

            if (tmpBalance.data != null)
            {
                PropertyInfo tmp = typeof(WDBalance).GetProperty(CurrentCurrency.ToLower());
                if (tmp != null)
                {
                    decimal balance = (decimal)tmp.GetValue(tmpBalance.data.balance);
                    Stats.Balance = balance;
                }
            }
            return(tmpBalance.status == "success");
        }
示例#2
0
 bool getbalance()
 {
     try
     {
         string         response   = Client.GetStringAsync("user").Result;
         WDUserResponse tmpBalance = json.JsonDeserialize <WDUserResponse>(response);
         if (tmpBalance.data != null)
         {
             PropertyInfo tmp = typeof(WDBalance).GetProperty(Currency.ToLower());
             if (tmp != null)
             {
                 decimal balance = (decimal)tmp.GetValue(tmpBalance.data.balance);
                 this.balance = balance;
                 Parent.updateBalance(balance);
             }
         }
         return(tmpBalance.status == "success");
     }
     catch (Exception e)
     {
         Parent.DumpLog(e.ToString(), -1);
     }
     return(false);
 }