예제 #1
0
 public async void Refresh()
 {
     foreach (var item in Portfaills)
     {
         JobsStatusSend?.Invoke($"Load {item.Account_Id} Portfolio stocks");
         item.FromTinkoff_stock(await Static_info.CurrentContext.PortfolioAsync(item.Account_Id));
         JobsStatusSend?.Invoke($"Load {item.Account_Id} Portfolio Money");
         item.Currencies_list = (await Static_info.CurrentContext.PortfolioCurrenciesAsync(item.Account_Id)).Currencies;
     }
 }
예제 #2
0
        public async Task doLoad()
        {
            try
            {
                JobsStatusSend?.Invoke("Load Account");
                var aa = await Static_info.CurrentContext.AccountsAsync();

                foreach (var item in aa)
                {
                    Portfaills.Add(new Portfaill(item.BrokerAccountId, item.BrokerAccountType));
                }
                Refresh();
                JobsStatusSend?.Invoke("Done");
                JobsDone?.Invoke(true);
            }
            catch (Exception ex)
            {
                JobsDone?.Invoke(false, ex.Message);
            }
        }