Exemplo n.º 1
0
        private void ExpandNode(DataNode node)
        {
            if (node == null || node.Populated)
            {
                return;
            }

            node.Nodes.Clear();
            ouTree.Update();
            try
            {
                DirectoryEntry parent = node.Tag as DirectoryEntry;

                foreach (DirectoryEntry child in parent.Children)
                {
                    AddTreeNode(node, child);
                }
            }
            catch (Exception ex)
            {
                ShowError("Unable to load Active Directory data.", ex);
            }

            node.Populated = true;
            node.Expand();
        }
Exemplo n.º 2
0
        private void ExpandNode(DataNode node)
        {
            if (node == null || node.Populated)
            {
                return;
            }

            node.Nodes.Clear();
            spaceTree.Update();

            switch (node.NodeType)
            {
            case USER:
                PopulateUser(node);
                break;

            case CUSTOMERS:
                PopulateCustomers(node);
                break;

            case SPACES:
                PopulateSpaces(node);
                break;
            }

            node.Populated = true;
            node.Expand();
        }
Exemplo n.º 3
0
        private void PopulateRootNode()
        {
            ouTree.Nodes.Clear();
            DirectoryEntry root = null;

            try
            {
                root = ADUtils.GetRootOU();
            }
            catch (Exception ex)
            {
                ShowError("Unable to load root OU.", ex);
            }
            if (root != null)
            {
                DataNode rootNode = AddTreeNode(null, root);
                rootNode.Expand();
            }
        }
Exemplo n.º 4
0
        private void PopulateRootNode(string username, string password)
        {
            spaceTree.Nodes.Clear();
            UserInfo info = null;

            try
            {
                info = UserController.GetUser(username);
                SecurityContext.SetThreadPrincipal(info);
            }
            catch (Exception ex)
            {
                ShowError("Unable to load user.", ex);
            }
            if (info != null)
            {
                DataNode rootNode = AddTreeNode(null, info.Username, 0, USER, info, true);
                rootNode.Expand();
            }
        }