Beispiel #1
0
        public async Task GetAssets()
        {
            // Account assets
            TTAccount account = await _client.GetAccountAsync();

            List <TTAsset> assets = null;

            if (account.AccountingType == TTAccountingTypes.Cash)
            {
                if (string.IsNullOrEmpty(AssetCurrency))
                {
                    assets = await _client.GetAllAssetsAsync();
                }
                else
                {
                    try
                    {
                        TTAsset asset = await _client.GetAssetAsync(AssetCurrency);

                        assets = new List <TTAsset>(new[] { asset });
                    }
                    catch (Exception)
                    {
                    }
                }
            }

            Assets = assets != null ? new ObservableCollection <TTAsset>(assets) : null;
        }