private async Task LoadContainersAsync(AccountNode accountNode) { await DoActionAsync(tslAccountStatus, "Loading containers...", async() => { var service = new BlobService(accountNode.Account.Name, accountNode.Account.Key); var containers = await service.ListContainersAsync(); tvwObjects.BeginUpdate(); accountNode.LoadChildren(containers); tvwObjects.EndUpdate(); }); }
private async void TbSearchContainers_KeyDown(object sender, KeyEventArgs e) { try { string searchText = tbSearchContainers.Text; if (e.KeyCode == Keys.Enter) { if (!string.IsNullOrEmpty(searchText)) { await DoActionAsync(tslAccountStatus, "Searching containers...", async() => { tvwObjects.Nodes.Clear(); var root = AddRootNode(); foreach (var acc in _options.Accounts) { var service = new BlobService(acc.Name, acc.Key); var containers = await service.ListContainersAsync(searchText); if (containers.Any()) { var accountNode = new AccountNode(acc); root.Nodes.Add(accountNode); tvwObjects.BeginUpdate(); accountNode.LoadChildren(containers); tvwObjects.EndUpdate(); accountNode.Expand(); } } root.Expand(); }); } else { FillAccounts(); } } } catch (Exception exc) { MessageBox.Show(exc.Message); } }