private void File_Close_Click(object sender, RoutedEventArgs e) { wsdlEditor.Text = ""; wsdlTree.Items.Clear(); wsdlIn = new WsdlDocument(); wsdlOut = new WsdlDocument(); }
private void UpdateDocumentView(WsdlDocument document) { StringWriter writer = new StringWriter(); document.serviceDescription.Write(writer); wsdlEditor.Text = writer.GetStringBuilder().ToString(); foldingStrategy.UpdateFoldings(foldingManager, wsdlEditor.Document); }
private void SetUpOutputWsdl(WsdlDocument inputDocument) { wsdlOut.LoadServiceDescription(wsdlIn.FileName); foreach (Binding binding in wsdlOut.serviceDescription.Bindings) { binding.Operations.Clear(); } foreach (PortType portType in wsdlOut.serviceDescription.PortTypes) { portType.Operations.Clear(); } wsdlOut.serviceDescription.ValidationWarnings.Clear(); UpdateDocumentView(wsdlOut); }
private void File_Open_Click(object sender, RoutedEventArgs e) { OpenFileDialog openDialog = new OpenFileDialog(); openDialog.Filter = "Web Service | *.wsdl;*.xml"; if (openDialog.ShowDialog().Value) { string fileName = openDialog.FileName; statusFileName.Text = fileName; wsdlIn = new WsdlDocument(fileName, "Input File"); wsdlOut = new WsdlDocument("mangled_" + fileName, "Output File"); if (wsdlIn.LoadServiceDescription(wsdlIn.FileName)) { LoadWsdlTreeView(wsdlIn); } } }
private void LoadWsdlTreeView(WsdlDocument wsdl) { wsdlTree.Items.Clear(); foreach (Service service in wsdl.serviceDescription.Services) { WsdlTreeViewItem serviceTreeItem = new WsdlTreeViewItem(); serviceTreeItem.PropertyChanged += new PropertyChangedEventHandler(TreeItem_Change); serviceTreeItem.Name = service.Name; serviceTreeItem.Type = WsdlElementType.Service; foreach (Port port in service.Ports) { string portBinding = port.Binding.Name; foreach (Binding binding in wsdl.serviceDescription.Bindings) { if (binding.Name == portBinding) { WsdlTreeViewItem bindingTreeItem = new WsdlTreeViewItem(); bindingTreeItem.PropertyChanged += new PropertyChangedEventHandler(TreeItem_Change); bindingTreeItem.Name = binding.Name; bindingTreeItem.Parent = serviceTreeItem; bindingTreeItem.Type = WsdlElementType.Binding; foreach (OperationBinding operation in binding.Operations) { WsdlTreeViewItem operationTreeItem = new WsdlTreeViewItem(); operationTreeItem.PropertyChanged += new PropertyChangedEventHandler(TreeItem_Change); operationTreeItem.Name = operation.Name; operationTreeItem.Parent = bindingTreeItem; operationTreeItem.Type = WsdlElementType.Operation; bindingTreeItem.Children.Add(operationTreeItem); } bindingTreeItem.Children.Sort(); serviceTreeItem.Children.Add(bindingTreeItem); SetUpOutputWsdl(wsdl); } } } wsdlTree.Items.Add(serviceTreeItem); wsdlTree.Items.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending)); } }