private SharedWorkFolderNode Populate(DataRow dr, DataRelation rel)
        {
            AccessLevel nodeRights = AccessLevel.ReadOnly;
            var         byteRights = (byte)dr[Environment.SharedFolderData.RightsField];

            if (byteRights == (int)AccessLevel.FullAccess)
            {
                nodeRights = AccessLevel.FullAccess;
            }

            var node = new SharedWorkFolderNode(
                (int)dr[Environment.SharedFolderData.IDField],      // id
                (string)dr[Environment.SharedFolderData.NameField], // text
                nodeRights,
                fullAccessOnly);

            foreach (SharedWorkFolderNode newNode in dr.GetChildRows(rel).Select(row => Populate(row, rel)))
            {
                node.Nodes.Add(newNode);
            }

            return(node);
        }
        public new void LoadSubNodes()
        {
            try
            {
                Nodes.Clear();

                if (TreeView != null)
                {
                    TreeView.Cursor = Cursors.WaitCursor;
                }

                using (DataSet ds = fullAccessOnly ? Environment.SharedFolderData.GetFullAccessFolders(Emp.ID) : Environment.SharedFolderData.GetFolders(Emp.ID, System.Threading.CancellationToken.None))
                    using (DataTable dt = ds.Tables[Environment.SharedFolderData.TableName])
                    {
                        DataRelation rel = ds.Relations[Environment.SharedFolderData.ParentRelation];

                        foreach (DataRow dr in dt.Rows)
                        {
                            DataRow[] drs = dr.GetParentRows(rel);
                            if (drs.Length == 0)
                            {
                                SharedWorkFolderNode node = Populate(dr, rel);
                                Nodes.Add(node);
                            }
                        }
                    }
                if (TreeView != null)
                {
                    TreeView.Cursor = Cursors.Default;
                }
            }
            catch (Exception ex)
            {
                Lib.Win.Data.Env.WriteToLog(ex);
            }
            base.LoadSubNodes();
        }