diff --git a/src/AddIns/Misc/SharpServerTools/ServerBrowserTool/SharpServerTools.addin b/src/AddIns/Misc/SharpServerTools/ServerBrowserTool/SharpServerTools.addin index 11b82c772a..5cfc2d8b12 100644 --- a/src/AddIns/Misc/SharpServerTools/ServerBrowserTool/SharpServerTools.addin +++ b/src/AddIns/Misc/SharpServerTools/ServerBrowserTool/SharpServerTools.addin @@ -27,4 +27,10 @@ class = "SharpDbTools.Oracle.Forms.OracleFormsArtefactFactory"/> + + + + + diff --git a/src/AddIns/Misc/SharpServerTools/ServerBrowserTool/Src/Forms/ServerToolTreeView.cs b/src/AddIns/Misc/SharpServerTools/ServerBrowserTool/Src/Forms/ServerToolTreeView.cs index 18dc82bb3f..3ba700004e 100644 --- a/src/AddIns/Misc/SharpServerTools/ServerBrowserTool/Src/Forms/ServerToolTreeView.cs +++ b/src/AddIns/Misc/SharpServerTools/ServerBrowserTool/Src/Forms/ServerToolTreeView.cs @@ -21,15 +21,35 @@ namespace SharpServerTools.Forms /// maintaining this model/s of underlying services. /// public class ServerToolTreeView : TreeView, IRebuildable - { + { + public const string SERVERTOOL_PATH = "/SharpServerTools/ServerTool"; + public ServerToolTreeView(): base() { - // TODO: iterate through plugins retrieved from AddIn Tree - Type dbExplorerType = Type.GetType("SharpDbTools.Forms.DatabaseExplorerTreeNode, SharpDbTools"); - TreeNode dbExplorerNode = (TreeNode)Activator.CreateInstance(dbExplorerType); - IRequiresRebuildSource s = dbExplorerNode as IRequiresRebuildSource; - s.RebuildRequiredEvent += new RebuildRequiredEventHandler(RebuildRequiredNotify); - this.Nodes.Add(dbExplorerNode); + + AddInTreeNode node = + AddInTree.GetTreeNode(SERVERTOOL_PATH); + List codons = node.Codons; + foreach (Codon codon in codons) { + // create an instance of the relevant ServerTool TreeNode + string id = codon.Id; + TreeNode treeNode = (TreeNode)node.BuildChildItem(id, null, null); + IRequiresRebuildSource s = treeNode as IRequiresRebuildSource; + + // a ServerTool plugin can register to be refreshed by the ServerToolTreeView + // control by implementing the IRequiresRebuildSource interface + + if (s != null) { + s.RebuildRequiredEvent += new RebuildRequiredEventHandler(RebuildRequiredNotify); + } + this.Nodes.Add(dbExplorerNode); + } + +// Type dbExplorerType = Type.GetType("SharpDbTools.Forms.DatabaseExplorerTreeNode, SharpDbTools"); +// TreeNode dbExplorerNode = (TreeNode)Activator.CreateInstance(dbExplorerType); +// IRequiresRebuildSource s = dbExplorerNode as IRequiresRebuildSource; +// s.RebuildRequiredEvent += new RebuildRequiredEventHandler(RebuildRequiredNotify); +// this.Nodes.Add(dbExplorerNode); } public void RebuildChildren(IEnumerable children)