private void tvwBrowser_AfterSelect(object sender, TreeViewEventArgs e) { XmlDocument doc = new XmlDocument(); if (e.Node.Tag != null) { SelectedManifest = writer.Manifests[Convert.ToInt32(e.Node.Tag)]; } TabPage tbp = tbpProperties; switch (e.Node.ImageIndex) { case 1: string[] dependency = e.Node.Name.ToString().Split('|'); pgInspector.SelectedObject = SelectedManifest.Dependencies[Int32.Parse(dependency[1])]; break; case 4: pgInspector.SelectedObject = SelectedManifest; break; case 5: pgInspector.SelectedObject = SelectedManifest.CurrentAssembly; break; case 8: Assembly asm = Assembly.Load(SelectedManifest.CurrentAssembly.AssemblyStream); Type mod = asm.GetType(SelectedManifest.CurrentAssembly.AssemblyName + "." + e.Node.Text); pgInspector.SelectedObject = mod; break; case 10: tbp = tbpContractViewer; doc.LoadXml(SelectedManifest.DataContracts[e.Node.Parent.Text]); doc.Save("output.xsd"); wbContractViewer.Navigate(Environment.CurrentDirectory + "\\output.xsd"); break; case 11: tbp = tbpContractViewer; doc.LoadXml(SelectedManifest.ServiceWsdls[e.Node.Parent.Text]); doc.Save("output.wsdl"); wbContractViewer.Navigate(Environment.CurrentDirectory + "\\output.wsdl"); break; } tbcOutput.SelectedTab = tbp; }
void ProcessManifest(DnrManifest manifest,string manifestName) { SelectedManifest = manifest; TreeNode newNode = new TreeNode(); newNode.Text = manifestName; newNode.StateImageIndex = 4; newNode.ImageIndex = 4; newNode.Tag = writer.Manifests.IndexOf(manifest); // Add the children TreeNode assem = new TreeNode("Current Assembly: " + SelectedManifest.CurrentAssembly.Name, 5, 5); assem.Tag = newNode.Tag; // Add the interfaces foreach (string service in SelectedManifest.GetAvailableServices()) { ProcessManifestMethods(assem, service); } newNode.Nodes.Add(assem); ProcessManifestDependencies(newNode); if (tvwBrowser.SelectedNode.ImageIndex == 3) { tvwBrowser.SelectedNode.Nodes.Add(newNode); } else { tvwBrowser.SelectedNode.FirstNode.Parent.Nodes.Add(newNode); } ProcessManifestOutput(); ProcessNamespaces(newNode); }