Пример #1
0
 private void OnPreparedExpand(IAsyncResult res)
 {
     try
     {
         try
         {
             m_node.EndLoadChildren(res);
             m_tree.Tree.BeginUpdate();
             m_expanding = false;
             FillChildren();
             Expand();
             RefreshSelf();
             m_node.NotifyExpanded();
         }
         finally
         {
             m_tree.Tree.EndUpdate();
         }
     }
     catch (Exception e)
     {
         Errors.Report(e);
     }
     ProcessRegister.RemoveBackgroundTask("s_expand");
 }
Пример #2
0
        //public static List<IVirtualFolder> GetFolderSet(this ITreeNode node, string dbsubfolder)
        //{
        //    ITreeNode seldb = node.GetDatabaseNode();
        //    if (seldb == null) return null;

        //    string dbname = node.GetDatabaseName();
        //    IPhysicalConnection conn = MainWindowExtension.SelectedConnection;
        //    if (conn != null && conn.SystemConnection != null)
        //    {
        //        DXDriver driver = PhysicalConnectionExtension.GetDXDriver(conn);
        //        IVirtualFolder local = new FileSystemFolder(seldb.GetPrivateSubFolder(dbsubfolder));
        //        List<IVirtualFolder> res = new List<IVirtualFolder>();
        //        res.Add(local);
        //        if (driver != null)
        //        {
        //            IVirtualFolder onserver = driver.GetFolder(dbsubfolder, dbname);
        //            res.Add(onserver);
        //        }
        //        return res;
        //    }
        //    return null;
        //}

        public static ITreeNode[] GetChildrenNow(this ITreeNode node)
        {
            if (!node.PreparedChildren)
            {
                IAsyncResult async = node.BeginLoadChildren(null);
                Async.WaitFor(async);
                node.EndLoadChildren(async);
            }
            return(node.GetChildren());
        }