protected override void OnFetchCompleted(IList <TreeItem> data) { if (TreeListBox.IsDisposed) { return; } TreeListBox.BeginUpdate(); TreeListBox.Items.Clear(); foreach (var item in data) { if (item.ItemType == TreeItemType.Tree) { TreeListBox.Items.Add(new TreeDirectoryListItem( (TreeDirectory)item, TreeDirectoryListItemType.ShowNothing)); } else { TreeListBox.Items.Add(new TreeFileListItem( (TreeFile)item, true)); } } TreeListBox.EndUpdate(); TreeListBox.Cursor = Cursors.Default; }
protected override void OnFetchFailed(Exception exception) { if (TreeListBox.IsDisposed) { return; } TreeListBox.BeginUpdate(); TreeListBox.Items.Clear(); TreeListBox.EndUpdate(); TreeListBox.Cursor = Cursors.Default; }
protected override void OnFetchCompleted(IList <TreeFile> data) { if (TreeListBox.IsDisposed) { return; } TreeListBox.BeginUpdate(); TreeListBox.Items.Clear(); foreach (var item in data) { TreeListBox.Items.Add(new TreeFileListItem(item, true)); } TreeListBox.EndUpdate(); TreeListBox.Cursor = Cursors.Default; }