コード例 #1
0
 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);
     }
 }
コード例 #2
0
 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;
             }
         }
     }
 }
コード例 #3
0
 private void partRenaming(object sender, PartEventArgs e)
 {
     Node.Text = e.Tag as string;
 }