private void partAdding(object sender, PartEventArgs e) { if (e.Part.IsFolder) { var pnode = new PartNode(e.Part as PartFolder, CreateImageNodes); pnode.Parent = this; Nodes.Add(pnode); Node.Nodes.Add(pnode.Node); } else if (CreateImageNodes) { var pnode = new PartNode(e.Part as ImagePart, this); Nodes.Add(pnode); } }
private void partRemoving(object sender, PartEventArgs e) { if (e.Part.IsFolder || CreateImageNodes) { foreach (var pnode in Nodes) { if (pnode.Part == e.Part) { Node.Nodes.Remove(pnode.Node); Nodes.Remove(pnode); pnode.Dispose(); return; } } } }
private void partRenaming(object sender, PartEventArgs e) { Node.Text = e.Tag as string; }