public IEnumerable GetChildren(object parent) { ObservableCollection <ServerTreeItem> observableCollection = new ObservableCollection <ServerTreeItem>(); if (parent == null) { if (string.IsNullOrWhiteSpace(this._currentFilter)) { return(this._treeData); } foreach (ServerTreeItem current in this._treeData) { if (!IsNullOrEmptyExtension.IsNullOrEmpty(this.GetChildren(current))) { observableCollection.Add(current); } } return(observableCollection); } else { ServerTreeItem serverTreeItem = parent as ServerTreeItem; if (serverTreeItem == null) { return(observableCollection); } if (string.IsNullOrEmpty(this._currentFilter)) { this.SortList(serverTreeItem.ServerTreeItems); return(serverTreeItem.ServerTreeItems); } foreach (ServerTreeItem current2 in serverTreeItem.ServerTreeItems) { if (current2.Name.IndexOf(this._currentFilter, StringComparison.InvariantCultureIgnoreCase) >= 0) { observableCollection.Add(current2); } } this.SortList(observableCollection); return(observableCollection); } }
public bool HasChildren(object parent) { ServerTreeItem expr_06 = parent as ServerTreeItem; return(expr_06 != null && expr_06.ServerTreeItems.Count > 0); }
public void RenderChildren(object parent) { ServerTreeItem serverTreeItem = parent as ServerTreeItem; this.PingList((serverTreeItem != null) ? serverTreeItem.ServerTreeItems : null); }