private bool ReloadTreeNode(CatalogItem target, TreeNode tn) { CatalogItem ci = tn.Tag as CatalogItem; if (ci != null) { if (target != null) { if (target.Equals(tn.Tag as CatalogItem)) { tn.Text = (tn.Tag as CatalogItem).Name; return true; } } else { tn.Text = ci.Name; } } if (tn.Nodes != null && tn.Nodes.Count > 0) { if (target != null) { foreach (TreeNode node in tn.Nodes) { if (target.Equals(node.Tag as CatalogItem)) { node.Text = (node.Tag as CatalogItem).Name; return true; } } } foreach (TreeNode node in tn.Nodes) { if (ReloadTreeNode(target, node)) return true; } } return false; }
internal void Reload(CatalogItem target) { foreach (ListViewItem item in this.Items) { CatalogItem ci = item.Tag as CatalogItem; if (ci != null) { if (target != null) { if (target.Equals(ci)) { item.SubItems[colItemName.Index].Text = ci.Name; return; } } else { item.SubItems[colItemName.Index].Text = ci.Name; } } } }
internal void Reload(CatalogItem target) { if (target != null) { foreach (TreeNode node in Nodes) { if (target.Equals(node.Tag as CatalogItem)) { node.Text = (node.Tag as CatalogItem).Name; return; } } } foreach (TreeNode node in Nodes) { if (ReloadTreeNode(target, node)) return; } }
public void RemoveItem(CatalogItem item) { if (item != null) { foreach (ListViewItem row in this.Items) { if (item.Equals(row.Tag as CatalogItem)) { this.Items.Remove(row); break; } } } }