protected void RefreshSPPersistedObject()
        {
            ExplorerNodeBase parent = this.Parent as ExplorerNodeBase;

            Program.Window.Explorer.SelectedNode = null;
            Program.Window.Explorer.DisposeObjectModelNodes(parent);
            parent.HasChildrenLoaded = false;
            Program.Window.Explorer.ExpandNode(parent);

            foreach (ExplorerNodeBase node in parent.Nodes)
            {
                if (node.Name.Equals(this.Name))
                {
                    Program.Window.Explorer.SelectedNode = node;
                    //Program.Window.propertyGrid.SelectedObject = node.Tag;

                    if (this.IsExpanded)
                    {
                        node.HasChildrenLoaded = false;
                        //Program.Window.Explorer.ExpandNode(node);
                        this.Expand();
//                        this.Toggle();
                    }
                    break;
                }
            }
        }
        protected void RefreshWss2Objects()
        {
            ArrayList list = SaveStucture(this);

            if (list.Count > 0)
            {
                ExplorerNodeBase appNode = GetWebApp(this);
                Program.Window.Explorer.SelectedNode = null;
                if (appNode != null && appNode.Tag is SPWebApplication)
                {
                    Program.Window.Explorer.DisposeObjectModelNodes(appNode);
                    ((SPPersistedObject)appNode.Tag).Uncache();

                    Reload(appNode, list);

                    if (this.IsExpanded)
                    {
                        this.HasChildrenLoaded = false;
                        //Program.Window.Explorer.ExpandNode(CurrentNode);
                        this.Expand();
                    }
                }
            }
            else
            {
                throw new ApplicationException(SPMLocalization.GetString("ExplorerBase_Error"));
            }
        }
Пример #3
0
 public void ExpandNode(ExplorerNodeBase node)
 {
     if (!node.HasChildrenLoaded)
     {
         node.HasChildrenLoaded = true;
         node.LoadNodes();
     }
 }
Пример #4
0
        protected override void OnBeforeExpand(TreeViewCancelEventArgs e)
        {
            ExplorerNodeBase node = e.Node as ExplorerNodeBase;

            ExpandNode(node);

            base.OnBeforeExpand(e);
        }
Пример #5
0
 private void DefaultExpand(ExplorerNodeBase parent)
 {
     if (parent.DefaultExpand)
     {
         parent.Expand();
         foreach (ExplorerNodeBase child in parent.Nodes)
         {
             DefaultExpand(child);
         }
     }
 }
Пример #6
0
        public void UpdateMenu(ExplorerNodeBase node)
        {
            toolStripSave.Enabled = ChangedNodes.ContainsKey(node);
            toolStripSaveAll.Enabled = ChangedNodes.Count > 0;
            toolStripCancel.Enabled = ChangedNodes.Count > 0;
            toolStripRefresh.Enabled = true;

            saveallToolStripMenuItem.Enabled = ChangedNodes.Count > 0;
            saveToolStripMenuItem.Enabled = ChangedNodes.ContainsKey(node);
            cancelToolStripMenuItem.Enabled = ChangedNodes.Count > 0;
            refreshToolStripMenuItem.Enabled = true;
        }
        public void AddNode(NodeDisplayLevelType requiredlevel, ExplorerNodeBase node)
        {
            TreeViewExplorer exp = this.TreeView as TreeViewExplorer;

            int level  = (int)exp.DisplayLevel;
            int result = level & (int)requiredlevel;

            if (result >= 1)
            {
                this.Nodes.Add(node);
            }
        }
Пример #8
0
        public void ExpandNode(ExplorerNodeBase node)
        {
            if (!node.HasChildrenLoaded)
            {
                Cursor.Current = Cursors.WaitCursor;

                node.HasChildrenLoaded = true;
                node.LoadNodes();

                Cursor.Current = Cursors.Default;
            }
        }
Пример #9
0
        protected override void OnBeforeExpand(TreeViewCancelEventArgs e)
        {
            ExplorerNodeBase node = e.Node as ExplorerNodeBase;

            if (node == null)
            {
                return;
            }

            Worker(() => ExpandNode(node));

            base.OnBeforeExpand(e);
        }
        private ExplorerNodeBase GetWebApp(ExplorerNodeBase start)
        {
            ExplorerNodeBase child = start;

            while (child != null)
            {
                if (child.Tag is SPWebApplication)
                {
                    return(child);
                }
                child = child.Parent as ExplorerNodeBase;
            }
            return(null);
        }
        public ExplorerNodeBase GetNodeByTag(object objTag)
        {
            ExplorerNodeBase result = null;

            foreach (ExplorerNodeBase node in this.Nodes)
            {
                if (node.SPObject == objTag)
                {
                    result = node;
                    break;
                }
            }
            return(result);
        }
Пример #12
0
 private void DefaultExpand(ExplorerNodeBase parent)
 {
     if (parent.DefaultExpand)
     {
         parent.Expand();
         if (!Properties.Settings.Default.ShallowExpand)
         {
             foreach (ExplorerNodeBase child in parent.Nodes)
             {
                 DefaultExpand(child);
             }
         }
     }
 }
        private ArrayList SaveStucture(ExplorerNodeBase currentNode)
        {
            ArrayList list = new ArrayList();

            list.Add(currentNode.Name.Clone());
            ExplorerNodeBase child = currentNode.Parent as ExplorerNodeBase;

            while (child != null)
            {
                list.Insert(0, child.Name.Clone());
                if (child.Tag is SPSiteCollection)
                {
                    break;
                }
                child = child.Parent as ExplorerNodeBase;
            }

            return(list);
        }
        public override void LoadNodes()
        {
            base.LoadNodes();

            // Property icon
            int index = 6;

            foreach (DictionaryEntry entry in this.PropertyBag)
            {
                ExplorerNodeBase node = new ExplorerNodeBase(entry.Key.ToString());
                node.ToolTipText = "";
                node.Name        = entry.Key.ToString();
                node.Tag         = entry;
                node.SPParent    = this.SPParent;

                node.ImageIndex         = index;
                node.SelectedImageIndex = index;

                this.Nodes.Add(node);
            }
        }
Пример #15
0
        public override void LoadNodes()
        {
            base.LoadNodes();

            // Property icon
            int index = 6;

            foreach (DictionaryEntry entry in this.PropertyBag)
            {
                ExplorerNodeBase node = new ExplorerNodeBase(entry.Key.ToString());
                node.ToolTipText = "";
                node.Name = entry.Key.ToString();
                node.Tag = entry;
                node.SPParent = this.SPParent;

                node.ImageIndex = index;
                node.SelectedImageIndex = index;

                this.Nodes.Add(node);
            }
        }
        private void Reload(ExplorerNodeBase parent, ArrayList list)
        {
            if (list.Count > 0)
            {
                parent.HasChildrenLoaded = false;
                Program.Window.Explorer.ExpandNode(parent);

                string name = list[0] as string;
                list.RemoveAt(0);
                foreach (ExplorerNodeBase node in parent.Nodes)
                {
                    if (node.Name.Equals(name))
                    {
                        Program.Window.Explorer.SelectedNode = node;
                        //Program.Window.propertyGrid.SelectedObject = node.Tag;
                        Reload(node, list);
                        break;
                    }
                }
            }
        }
Пример #17
0
        public void AddNode(NodeDisplayLevelType requiredlevel, ExplorerNodeBase node)
        {
            if (node.NewFeatureIn2010)
            {
                node.BackColor = Color.LightGray;
            }
            else
            {
                node.BackColor = Color.Empty;
            }

            TreeViewExplorer exp = this.TreeView as TreeViewExplorer;

            int level  = (int)exp.DisplayLevel;
            int result = level & (int)requiredlevel;

            if (result >= 1)
            {
                this.Nodes.Add(node);
            }
        }
Пример #18
0
        public void Build()
        {
            Cursor.Current = Cursors.WaitCursor;
            this.ImageList = Program.Window.SPMimageList;
            Nodes.Clear();
            BeginUpdate();
            TreeViewNodeSorter = new NodeSorter();

            ExplorerNodeBase root = null;

            root = new FarmNode(CurrentFarm);
            this.Nodes.Add(root);

            Sort();
            DefaultExpand(root);


            this.SelectedNode = root;

            EndUpdate();
            Cursor.Current = Cursors.Default;
        }
Пример #19
0
        public void AddNode(NodeDisplayLevelType requiredlevel, ExplorerNodeBase node)
        {
            TreeViewExplorer exp = this.TreeView as TreeViewExplorer;

            int level = (int)exp.DisplayLevel;
            int result = level & (int)requiredlevel;
            if (result >= 1)
            {
                this.Nodes.Add(node);
            }
        }
Пример #20
0
 private void DefaultExpand(ExplorerNodeBase parent)
 {
     if (parent.DefaultExpand)
     {
         parent.Expand();
         foreach (ExplorerNodeBase child in parent.Nodes)
         {
             DefaultExpand(child);
         }
     }
 }
Пример #21
0
        public void ExpandNode(ExplorerNodeBase node)
        {
            if (!node.HasChildrenLoaded)
            {
                Cursor.Current = Cursors.WaitCursor;

                node.HasChildrenLoaded = true;
                node.LoadNodes();

                Cursor.Current = Cursors.Default;
            }
        }
Пример #22
0
 private ExplorerNodeBase GetWebApp(ExplorerNodeBase start)
 {
     ExplorerNodeBase child = start;
     while (child != null)
     {
         if (child.Tag is SPWebApplication)
         {
             return child;
         }
         child = child.Parent as ExplorerNodeBase;
     }
     return null;
 }
Пример #23
0
        private void Reload(ExplorerNodeBase parent, ArrayList list)
        {
            if (list.Count > 0)
            {
                parent.HasChildrenLoaded = false;
                Program.Window.Explorer.ExpandNode(parent);

                string name = list[0] as string;
                list.RemoveAt(0);
                foreach (ExplorerNodeBase node in parent.Nodes)
                {
                    if (node.Name.Equals(name))
                    {
                        Program.Window.Explorer.SelectedNode = node;
                        //Program.Window.propertyGrid.SelectedObject = node.Tag;
                        Reload(node, list);
                        break;
                    }
                }
            }
        }
Пример #24
0
        private ArrayList SaveStucture(ExplorerNodeBase currentNode)
        {
            ArrayList list = new ArrayList();

            list.Add(currentNode.Name.Clone());
            ExplorerNodeBase child = currentNode.Parent as ExplorerNodeBase;
            while (child != null)
            {
                list.Insert(0, child.Name.Clone());
                if (child.Tag is SPSiteCollection)
                {
                    break;
                }
                child = child.Parent as ExplorerNodeBase;
            }

            return list;
        }
Пример #25
0
        public void ExpandNode(ExplorerNodeBase node)
        {
            if (!node.HasChildrenLoaded)
            {
                node.HasChildrenLoaded = true;
                node.LoadNodes();

            }
        }
Пример #26
0
 private void DefaultExpand(ExplorerNodeBase parent)
 {
     if (parent.DefaultExpand)
     {
         parent.Expand();
         if (!Properties.Settings.Default.ShallowExpand)
         {
             foreach (ExplorerNodeBase child in parent.Nodes)
             {
                 DefaultExpand(child);
             }
         }
     }
 }
Пример #27
0
        private void ExplorerClick(ExplorerNodeBase node)
        {
            Cursor.Current = Cursors.WaitCursor;

            this.toolStripStatusLabel.Text = node.ToolTipText;
            UpdateMenu(node);

            ArrayList nodeColl = new ArrayList(node.GetTabPages());

            int i = 0;
            while (i < tabControl.TabPages.Count)
            {
                TabPage page = tabControl.TabPages[i];
                if (nodeColl.Contains(page))
                {
                    i++;
                }
                else
                {
                    tabControl.TabPages.Remove(page);
                }
            }

            foreach (TabPage page in nodeColl)
            {
                if (!tabControl.Contains(page))
                {
                    tabControl.TabPages.Add(page);
                }
            }

            //tabControl.Update();
            Cursor.Current = Cursors.Default;
        }
Пример #28
0
        public void AddNode(NodeDisplayLevelType requiredlevel, ExplorerNodeBase node)
        {
            if (node.NewFeatureIn2010)
            {
                node.BackColor = Color.LightGray;
            }
            else
            {
                node.BackColor = Color.Empty;
            }

            TreeViewExplorer exp = this.TreeView as TreeViewExplorer;

            int level = (int)exp.DisplayLevel;
            int result = level & (int)requiredlevel;
            if (result >= 1)
            {
                this.Nodes.Add(node);
            }
        }