Exemplo n.º 1
0
        //public bool TaskExpired(string HITId)
        //{
        //    HIT h = client.GetHIT(HITId);
        //    long lifeTimeInSeconds = h.AssignmentDurationInSeconds;
        //    //Console.WriteLine(lifeTimeInSeconds);
        //    if(lifeTimeInSeconds >0)
        //    {
        //        return false;
        //    }
        //    else
        //    {
        //        return true;
        //    }

        //}

        public double getAccountBalance()
        {
            try
            {
                GetAccountBalanceResult result = client.GetAccountBalance();
                Price p = result.AvailableBalance;
                Console.WriteLine("Account Balance: {0}", (double)p.Amount);
                return((double)p.Amount);
            }
            catch (Exception)
            {
                return(-1);
            }
        }