Inheritance: Raccoom.Windows.Forms.TreeNodeBase
        public override bool HasSelectedChildNodes(System.Collections.ObjectModel.Collection<string> items, TreeNodePath node)
        {
            bool isBold = false;
            //
            foreach (string s in items)
            {
                // if path is equal, return
                if (s.Equals(node.Path)) continue;

                var currentSelectedPath = s;
                var currentNodePath = node.Path;

                if (!currentSelectedPath.EndsWith("\\"))
                {
                    currentSelectedPath += "\\";
                }

                if (!currentNodePath.EndsWith("\\"))
                {
                    currentNodePath += "\\";
                }

                // if path is substring, mark node bold, otherwise normal font is used
                if (currentSelectedPath.IndexOf(currentNodePath) != -1)
                {
                    isBold = true;
                    break;
                }
                else
                {
                    isBold = false;
                }
            }
            return isBold;
        }
        public override void RequestSubDirs(TreeViewFolderBrowserHelper helper, TreeNodePath parent,
            TreeViewCancelEventArgs e)
        {
            if (!parent.IsSpecialFolder) return;
              //
              FolderItem2 folderItem = ((FolderItem2)parent.Tag);
              //
              if (_shell.Shell.NameSpace(ShellSpecialFolderConstants.ssfDRIVES).Title == folderItem.Name)
              {
            FillMyComputer(folderItem, parent.Nodes, helper);
              }
              else
              {
            List<TreeNodePath> nodes = new List<TreeNodePath>();
            foreach (FolderItem2 fi in ((Folder2)folderItem.GetFolder).Items())
            {
              if (!_showAllShellObjects && !fi.IsFileSystem || !fi.IsFolder) continue;
              //
              TreeNodePath node = CreateTreeNode(helper, fi.Name, fi.Path, IsFolderWithChilds(fi), false, true);
              node.Tag = fi;
              nodes.Add(node);
            }

            // Sort the Directories, as Samba might return unsorted
            TreeNodePath[] nodesArray = nodes.ToArray();
            Array.Sort(nodesArray,
                   new Comparison<TreeNodePath>(
                     delegate(TreeNodePath p1, TreeNodePath p2) { return string.Compare(p1.Text, p2.Text); }));

            parent.Nodes.AddRange(nodesArray);
              }
        }
        /// <summary>
        ///   Paste Button has been selected in Context Menu
        /// </summary>
        /// <param name = "sender"></param>
        /// <param name = "e"></param>
        private void contextMenuTreeViewPaste_Click(object sender, EventArgs e)
        {
            contextMenuTreeView.Items[2].Enabled = false; // Disable the Paste Menu item
              string targetPath = Path.Combine((treeViewFolderBrowser.SelectedNode as TreeNodePath).Path, _nodeToCopyCut.Text);
              try
              {
            if (!Directory.Exists(targetPath))
            {
              Directory.CreateDirectory(targetPath);
            }
              }
              catch (Exception ex)
              {
            log.Error("TreeView: Error creating folder {0}. {1}", targetPath, ex.Message);
              }

              bool bError = false;
              try
              {
            if (_actionCopy)
            {
              log.Debug("TreeView: Copying folder {0} to {1}", _nodeToCopyCut, targetPath);
              FileSystem.CopyDirectory(_nodeToCopyCut.Path, targetPath, UIOption.AllDialogs, UICancelOption.DoNothing);
            }
            else
            {
              log.Debug("TreeView: Moving folder {0} to {1}", _nodeToCopyCut, targetPath);
              FileSystem.MoveDirectory(_nodeToCopyCut.Path, targetPath, UIOption.AllDialogs, UICancelOption.DoNothing);
            }
              }
              catch (Exception ex)
              {
            bError = true;
            log.Error("TreeView: Error copying / moving folder {0}. {1}", _nodeToCopyCut.Path, ex.Message);
              }
              if (!bError)
              {
            _nodeToCopyCut = null;
            _main.CurrentDirectory = targetPath;
            RefreshFolders();
            _main.RefreshTrackList();
              }
        }
 /// <summary>
 /// Set the text bold for each parent node if there is a child node checked.
 /// </summary>
 /// <param name="parent"></param>
 protected virtual void MarkNodesRecursive(TreeNodePath parent)
 {
     if (this._checkboxBehavior == CheckBoxBehaviorMode.None) return;
     //
     if (parent == null) return;
     //
     MarkNode(parent);
     if (parent.Parent != null)
     {
         MarkNodesRecursive(parent.Parent as TreeNodePath);
     }
 }
 /// <summary>
 /// Set the text bold if there is a child node checked.
 /// </summary>
 /// <param name="node"></param>
 protected internal virtual void MarkNode(TreeNodePath node)
 {
     if (node == null) throw new ArgumentNullException("node");
     //
     if (this._checkboxBehavior == CheckBoxBehaviorMode.None) return;
     //
     if (node == null) return;
     // no path selected, no node could be marked
     if (_folderList.Count == 0)
     {
         if ((node.NodeFont != null) && (node.NodeFont.Bold))
         {
             node.NodeFont = this.Font;
         }
         return;
     }
     // check current node path against selected item list (folderlist_)
     if (_dataProvider.HasSelectedChildNodes(_folderList, node))
     {
         node.NodeFont = boldFont_;
     }
     else
     {
         node.NodeFont = this.Font;
     }
 }
        public void RequestSubDirs(TreeViewFolderBrowserHelper helper, TreeNodePath parent, TreeViewCancelEventArgs e)
        {
            if (parent.Path == null)
              {
            return;
              }

              if (parent.Path == "")
              {
            rootFolder = RootFolder.None;
              }

              string sql = string.Empty;
              bool createDummyNode = true;
              string nodeTag;

              // We have a Special folder, when we are at the root level
              if (parent.IsSpecialFolder)
              {
            rootFolder = RootFolder.None;
              }

              if (rootFolder == RootFolder.None)
              {
            switch ((string)parent.Tag)
            {
              case "artist":
            rootFolder = RootFolder.Artist;
            sql = SQL_STMT_ARTIST;
            break;

              case "albumartist":
            rootFolder = RootFolder.AlbumArtist;
            sql = SQL_STMT_ALBUMARTIST;
            break;

              case "album":
            rootFolder = RootFolder.Album;
            sql = SQL_STMT_ALBUM;
            createDummyNode = false;
            break;

              case "genre":
            rootFolder = RootFolder.Genre;
            sql = SQL_STMT_GENRE;
            break;
            }
              }
              else if (rootFolder == RootFolder.Artist)
              {
            sql = string.Format(SQL_STMT_ARTISTSEARCH, Util.RemoveInvalidChars(parent.Path));
            isRootFolder = false;
            createDummyNode = false;
              }
              else if (rootFolder == RootFolder.AlbumArtist)
              {
            sql = string.Format(SQL_STMT_ALBUMARTISTSEARCH, Util.RemoveInvalidChars(parent.Path));
            isRootFolder = false;
            createDummyNode = false;
              }
              else if (rootFolder == RootFolder.Genre)
              {
            isRootFolder = false;
            string[] searchString = (parent.Tag as string).Split('\\');
            if (searchString.GetLength(0) == 2)
            {
              sql = string.Format(SQL_STMT_GENREARTISTSEARCH, Util.RemoveInvalidChars(parent.Path));
              createDummyNode = true;
            }
            else
            {
              sql = string.Format(SQL_STMT_GENREARTISTALBUMSEARCH, Util.RemoveInvalidChars(searchString[1]),
                              Util.RemoveInvalidChars(parent.Path));
              createDummyNode = false;
            }
              }

              string connection = string.Format(@"Data Source={0}", Options.MainSettings.MediaPortalDatabase);
              try
              {
            SQLiteConnection conn = new SQLiteConnection(connection);
            conn.Open();
            using (SQLiteCommand cmd = new SQLiteCommand())
            {
              cmd.Connection = conn;
              cmd.CommandType = CommandType.Text;
              cmd.CommandText = sql;
              log.Debug("TreeViewBrowser: Executing sql: {0}", sql);
              using (SQLiteDataReader reader = cmd.ExecuteReader())
              {
            while (reader.Read())
            {
              string dbValue = reader.GetString(0);
              TreeNodePath newNode = CreateTreeNode(helper, dbValue, dbValue, createDummyNode, false, false);
              if (isRootFolder)
              {
                nodeTag = (string)parent.Tag;
              }
              else
              {
                nodeTag = string.Format(@"{0}\{1}", parent.Tag, dbValue);
              }
              newNode.Tag = nodeTag;
              parent.Nodes.Add(newNode);
            }
              }
            }
            conn.Close();
              }
              catch (Exception ex)
              {
            log.Error("TreeViewBrowser: Error executing sql: {0}", ex.Message);
              }
        }
        public virtual void RequestSubDirs(TreeViewFolderBrowserHelper helper, TreeNodePath parent,
            TreeViewCancelEventArgs e)
        {
            if (parent.Path == null) return;
              //
              DirectoryInfo directory = new DirectoryInfo(parent.Path);
              // check persmission
              new FileIOPermission(FileIOPermissionAccess.PathDiscovery, directory.FullName).Demand();
              //

              // Sort the Directories, as Samba might return unsorted
              DirectoryInfo[] dirInfo = directory.GetDirectories();
              Array.Sort(dirInfo,
                 new Comparison<DirectoryInfo>(
                   delegate(DirectoryInfo d1, DirectoryInfo d2) { return string.Compare(d1.Name, d2.Name); }));

              foreach (DirectoryInfo dir in dirInfo)
              {
            if ((dir.Attributes & FileAttributes.Hidden) == FileAttributes.Hidden)
            {
              continue;
            }
            TreeNodePath newNode = CreateTreeNode(helper, dir.Name, dir.FullName, false,
                                              ((helper.TreeView.CheckboxBehaviorMode != CheckboxBehaviorMode.None) &&
                                               (parent.Checked)), false);
            parent.Nodes.Add(newNode);
            //
            try
            {
              if (dir.GetDirectories().GetLength(0) > 0)
              {
            newNode.AddDummyNode();
              }
            }
            catch {}
              }
        }
 /// <summary>
 ///   Add or removes the nodes recursive to or from the folderList_.
 /// </summary>
 /// <param name = "parent"></param>
 /// <param name = "add"></param>
 protected virtual void ExchangeFoldersRec(TreeNodePath parent, bool add)
 {
     foreach (TreeNodePath n in parent.Nodes)
       {
     if (n.Path != null)
     {
       ExchangePath(n.Path, add);
       MarkNode(parent);
     }
     //
     ExchangeFoldersRec(n, add);
       }
 }
 /// <summary>
 /// Creates a tree node and add it to the <c>parentNode</c>.
 /// </summary>
 /// <param name="parentNode">Parent node for the new created child node, can be null to indicate root level.</param>
 /// <param name="text">The text displayed in the label of the tree node.</param>
 /// <param name="path">The path the node represents.</param>
 /// <param name="addDummyNode">True to add + sign, otherwise no + sign appears.</param>
 /// <param name="forceChecked">True to check node in each case, otherwise false to allow normal check against selected paths.</param>
 /// <param name="isSpecialFolder">Specifies if this node is a special folder. Special folders do not request data from the attached data provider.</param>
 /// <returns>The newly created and added node</returns>
 public virtual TreeNodePath CreateTreeNode(TreeNodePath parentNode, string text, string path, bool addDummyNode, bool forceChecked, bool isSpecialFolder)
 {
     return CreateTreeNode(parentNode != null ? parentNode.Nodes : TreeView.Nodes, parentNode, text, path, addDummyNode, forceChecked, isSpecialFolder);
 }
 /// <summary>
 /// Creates a tree node and add it to the <c>TreeNodeCollection</c>.
 /// </summary>
 /// <param name="parentCollection"><c>TreeNodeCollection</c> to which the new node will added.</param>
 /// <param name="parentNode">Parent node for the new created child node.</param>
 /// <param name="text">The text displayed in the label of the tree node.</param>
 /// <param name="path">The path the node represents.</param>
 /// <param name="addDummyNode">True to add + sign, otherwise no + sign appears.</param>
 /// <param name="forceChecked">True to check node in each case, otherwise false to allow normal check against selected paths.</param>
 /// <param name="isSpecialFolder">Specifies if this node is a special folder. Special folders do not request data from the attached data provider.</param>
 /// <returns>The newly created and added node</returns>
 public virtual TreeNodePath CreateTreeNode(System.Windows.Forms.TreeNodeCollection parentCollection, TreeNodePath parentNode, string text, string path, bool addDummyNode, bool forceChecked, bool isSpecialFolder)
 {
     if (parentCollection == null) throw new ArgumentNullException("parentCollection");
     //
     if (_treeView.InvokeRequired)
     {
         return _treeView.Invoke(new CreateTreeNodeDelegate(CreateTreeNode), new object[] { parentNode, text, path, addDummyNode, forceChecked, isSpecialFolder }) as TreeNodePath;
     }
     //
     forceChecked = forceChecked || (TreeView.CheckBoxBehaviorMode == CheckBoxBehaviorMode.RecursiveChecked && (parentNode != null && parentNode.Checked));
     //
     TreeNodePath childNode = CreateTreeNode(text, path, addDummyNode, forceChecked, isSpecialFolder);
     parentCollection.Add(childNode);
     return childNode;
 }
 public override void QueryContextMenuItems(TreeNodePath node)
 {
     if (!EnableContextMenu) return;
     //
     Raccoom.Win32.ShellItem fi = node.Tag as Raccoom.Win32.ShellItem;
     if (fi == null) return;
     ////
     //foreach (.FolderItemVerb verb in fi..Verbs())
     //{
     //    if (verb.Name.Length == 0) continue;
     //    //
     //    MenuItemShellVerb item = new MenuItemShellVerb(verb);
     //    Helper.TreeView.ContextMenu.MenuItems.Add(item);
     //}
 }
 protected override void SetIcon(TreeViewFolderBrowser treeView, TreeNodePath node)
 {
     // base.SetIcon(treeView, node);
 }
 protected virtual TreeNodePath CreateTreeNode(System.Windows.Forms.TreeNodeCollection parentCollection, TreeNodePath parentNode, Raccoom.Win32.ShellItem shellItem)
 {
     if (shellItem == null) throw new ArgumentNullException("shellItem");
     //
     TreeNodePath node = CreateTreeNode(parentCollection, parentNode, shellItem.Text, shellItem.Path, !shellItem.IsFolder, shellItem.HasSubfolder, !shellItem.IsFileSystem);
     node.ImageIndex = shellItem.ImageIndex;
     node.SelectedImageIndex = shellItem.SelectedImageIndex;
     node.Tag = shellItem;
     //
     shellItem.ShellItemUpdated += delegate(object sender, EventArgs e)
     {
         node.Text = shellItem.Text;
         node.ImageIndex = shellItem.ImageIndex;
         node.SelectedImageIndex = shellItem.SelectedImageIndex;
     };
     return node;
 }
 public override void RequestChildNodes(TreeNodePath parent, System.Windows.Forms.TreeViewCancelEventArgs e)
 {
     Raccoom.Win32.ShellItem folderItem = ((Raccoom.Win32.ShellItem)parent.Tag);
     folderItem.Expand(this.ShowFiles, true, System.IntPtr.Zero);
     //
     TreeNodePath node = null;
     System.IO.DriveInfo driveInfo;
     //
     foreach (Raccoom.Win32.ShellItem childFolder in folderItem.SubFolders)
     {
         if (!_showAllShellObjects && !childFolder.IsFileSystem) continue;
         //
         if (DriveTypes != DriveTypes.All && childFolder.IsDisk)
         {
             driveInfo = new System.IO.DriveInfo(childFolder.Path);
             //
             switch (driveInfo.DriveType)
             {
                 case System.IO.DriveType.CDRom:
                     if ((DriveTypes & DriveTypes.CompactDisc) == 0) continue;
                     break;
                 case System.IO.DriveType.Fixed:
                     if ((DriveTypes & DriveTypes.LocalDisk) == 0) continue;
                     break;
                 case System.IO.DriveType.Network:
                     if ((DriveTypes & DriveTypes.NetworkDrive) == 0) continue;
                     break;
                 case System.IO.DriveType.NoRootDirectory:
                     if ((DriveTypes & DriveTypes.NoRootDirectory) == 0) continue;
                     break;
                 case System.IO.DriveType.Ram:
                     if ((DriveTypes & DriveTypes.RAMDisk) == 0) continue;
                     break;
                 case System.IO.DriveType.Removable:
                     if ((DriveTypes & DriveTypes.RemovableDisk) == 0) continue;
                     break;
                 case System.IO.DriveType.Unknown:
                     if ((DriveTypes & DriveTypes.NoRootDirectory) == 0) continue;
                     break;
             }
         }
         //
         node = CreateTreeNode(null, parent, childFolder);
     }
     if (!ShowFiles) return;
     //
     foreach (Raccoom.Win32.ShellItem fileItem in folderItem.SubFiles)
     {
         node = CreateTreeNode(null, parent, fileItem);
     }
 }
 /// <summary>
 ///   Creates a tree node and add it to the <c>TreeNodeCollection</c>.
 /// </summary>
 /// <param name = "text">The text displayed in the label of the tree node.</param>
 /// <param name = "path">The path the node represents.</param>
 /// <param name = "addDummyNode">True to add + sign, otherwise no + sign appears.</param>
 /// <param name = "forceChecked">True to check node in each case, otherwise false to allow normal check against selected paths.</param>
 /// <param name = "isSpecialFolder">Specifies if this node is a special folder. Special folders do not request data from the attached data provider.</param>
 /// <returns></returns>
 public virtual TreeNodePath CreateTreeNode(string text, string path, bool addDummyNode, bool forceChecked,
                                        bool isSpecialFolder)
 {
     TreeNodePath newNode = new TreeNodePath(text, isSpecialFolder);
       // path
       newNode.Path = path;
       //
       try
       {
     _treeView.SupressCheckEvent(true);
     //
     if (forceChecked)
     {
       newNode.Checked = true;
     }
     else
     {
       newNode.Checked = _treeView.SelectedDirectories.Contains(path);
     }
     _treeView.MarkNode(newNode);
       }
       catch (Exception e)
       {
     Debug.WriteLine(e.Message, _treeView.Name);
       }
       finally
       {
     _treeView.SupressCheckEvent(false);
       }
       //
       if (addDummyNode)
       {
     // add dummy node, otherwise there is no + sign
     newNode.AddDummyNode();
       }
       //
       return newNode;
 }
 /// <summary>
 ///   Set the text bold if there is a child node checked.
 /// </summary>
 /// <param name = "node"></param>
 protected internal virtual void MarkNode(TreeNodePath node)
 {
     if (_checkboxBehavior == CheckboxBehaviorMode.None) return;
       //
       if (node == null) return;
       // no path selected, no node could be marked
       if (folderList_.Count == 0)
       {
     try
     {
       if ((node.NodeFont != null) && (node.NodeFont.Bold))
       {
     node.NodeFont = Font;
       }
     }
     catch {}
     return;
       }
       // there are a few paths, so we have to check each against our node path
       string path = node.Path;
       //
       bool isBold = false;
       foreach (string s in folderList_)
       {
     // if path is equal, return
     if (s.Equals(path)) continue;
     // if path is substring, mark node bold, otherwise normal font is used
     if (s.IndexOf(path) != -1)
     {
       isBold = true;
       break;
     }
     else
     {
       isBold = false;
     }
       }
       //
       if (isBold)
       {
     node.NodeFont = boldFont_;
       }
       else
       {
     node.NodeFont = Font;
       }
 }
 protected override TreeNodePath CreateTreeNode(System.Windows.Forms.TreeNodeCollection parentCollection, TreeNodePath parentNode, string text, string path, bool isFile, bool addDummyNode, bool isSpecialFolder)
 {
     if (isFile && _hideFileExention)
     {
         text = System.IO.Path.GetFileNameWithoutExtension(path);
     }
     return base.CreateTreeNode(parentCollection, parentNode, text, path, isFile, addDummyNode, isSpecialFolder);
 }
 /// <summary>
 ///   Populates the Directory structure for a given path.
 /// </summary>
 /// <param name = "parent"></param>
 protected virtual void GetSubDirs(TreeNodePath parent, TreeViewCancelEventArgs e)
 {
     if (parent.Path == null) return;
       // everything ok, here we go
       BeginUpdate();
       try
       {
     parent.RemoveDummyNode();
     // if we have not scanned this folder before
     if (parent.Nodes.Count == 0)
     {
       _dataProvider.RequestSubDirs(_helper, parent, e);
     }
       }
       catch (Exception ex)
       {
     throw ex;
       }
       finally
       {
     EndUpdate();
       }
 }
 /// <summary>
 /// Creates a new node and assigns an icon
 /// </summary>
 protected virtual TreeNodePath CreateTreeNode(TreeNodePath parentNode, string text, string path, bool isFile, bool addDummyNode, bool isSpecialFolder)
 {
     return CreateTreeNode(parentNode != null ? parentNode.Nodes : Helper.TreeView.Nodes, parentNode, text, path, isFile, addDummyNode, isSpecialFolder);
 }
 public void QueryContextMenuItems(TreeViewFolderBrowserHelper helper, TreeNodePath node)
 {
 }
 /// <summary>
 /// Creates a new node and assigns an icon
 /// </summary>
 protected virtual TreeNodePath CreateTreeNode(System.Windows.Forms.TreeNodeCollection parentCollection, TreeNodePath parentNode, string text, string path, bool isFile, bool addDummyNode, bool isSpecialFolder)
 {
     TreeNodePath node = Helper.CreateTreeNode(parentCollection != null ? parentCollection : parentNode.Nodes, parentNode, text, path, addDummyNode, false, isSpecialFolder);
     try
     {
         SetIcon(Helper.TreeView, node);
     }
     catch
     {
         node.ImageIndex = -1;
         node.SelectedImageIndex = -1;
     }
     return node;
 }
        /// <summary>
        ///   Extract the icon for the file type (Extension)
        /// </summary>
        protected virtual void SetIcon(TreeViewFolderBrowser treeView, TreeNodePath node)
        {
            // create on demand
              if (_systemImageList == null)
              {
            // Shell32 ImageList
            _systemImageList = new SystemImageList(SystemImageListSize.SmallIcons);
            SystemImageListHelper.SetTreeViewImageList(treeView, _systemImageList, false);
              }

              node.ImageIndex = _systemImageList.IconIndex("", true);
              node.SelectedImageIndex = node.ImageIndex;
        }
 /// <summary>
 /// Extract the icon for the file type (Extension)
 /// </summary>
 protected virtual void SetIcon(TreeViewFolderBrowser treeView, TreeNodePath node)
 {
     if (_systemImageList == null) throw new ArgumentNullException("_systemImageList");
     if (treeView == null) throw new ArgumentNullException("treeView");
     if (node == null) throw new ArgumentNullException("node");
     //
     node.ImageIndex = this._systemImageList.IconIndex(node.Path, true, Raccoom.Win32.ShellIconStateConstants.ShellIconStateNormal);
     node.SelectedImageIndex = this._systemImageList.IconIndex(node.Path, true, Raccoom.Win32.ShellIconStateConstants.ShellIconStateOpen);
 }
 /// <summary>
 /// Add or removes the nodes recursive to or from the folderList_.
 /// </summary>
 /// <param name="parent"></param>
 /// <param name="add"></param>
 protected virtual void ExchangeFoldersRecursive(TreeNodePath parent, bool add)
 {
     if (parent == null) throw new ArgumentNullException("parent");
     //
     foreach (TreeNodePath n in parent.Nodes)
     {
         if (n.Path != null)
         {
             ExchangePath(n.Path, add);
             MarkNode(parent);
         }
         //
         ExchangeFoldersRecursive(n, add);
     }
 }
 public override void QueryContextMenuItems(TreeViewFolderBrowserHelper helper, TreeNodePath node)
 {
     if (!EnableContextMenu) return;
       //
       FolderItem fi = node.Tag as FolderItem;
       if (fi == null) return;
       //
       foreach (FolderItemVerb verb in fi.Verbs())
       {
     if (verb.Name.Length == 0) continue;
     //
     MenuItemShellVerb item = new MenuItemShellVerb(verb);
     helper.TreeView.ContextMenu.MenuItems.Add(item);
       }
 }
 /// <summary>
 /// Populates the Directory structure for a given path.
 /// </summary>
 /// <param name="parent">Parent node for which the data is to retrieve</param>
 /// <param name="e"><c>TreeViewCancelEventArgs</c> to abort current expanding.</param>
 protected virtual void RequestChildNodes(TreeNodePath parent, System.Windows.Forms.TreeViewCancelEventArgs e)
 {
     if (parent == null) throw new ArgumentNullException("parent");
     if (e == null) throw new ArgumentNullException("e");
     //
     if (!parent.HasDummyNode || parent.Path == null) return;
     // everything ok, here we go
     this.BeginUpdate();
     try
     {
         parent.RemoveDummyNode();
         // if we have not scanned this folder before
         _dataProvider.RequestChildNodes(parent, e);
     }
     finally
     {
         this.EndUpdate();
     }
 }
 /// <summary>
 ///   Cut Button has been selected in Context Menu
 /// </summary>
 /// <param name = "sender"></param>
 /// <param name = "e"></param>
 private void contextMenuTreeViewCut_Click(object sender, EventArgs e)
 {
     contextMenuTreeView.Items[2].Enabled = true; // Enable the Paste Menu item
       _actionCopy = false; // we do a move
       _nodeToCopyCut = treeViewFolderBrowser.SelectedNode as TreeNodePath;
 }