📄 addwebreferencedialog.cs
字号:
// created on 10/11/2002 at 2:06 PM
using Microsoft.Win32;
using System;
using System.Data;
using System.Drawing;
using System.CodeDom.Compiler;
using System.Collections;
using System.ComponentModel;
using System.IO;
using System.Net;
using System.Runtime.InteropServices;
using System.Runtime.Remoting.Messaging;
using System.Xml;
using System.Xml.Xsl;
using System.Web.Services.Description;
using System.Web.Services.Discovery;
using System.Windows.Forms;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.Core.Services;
using ICSharpCode.SharpDevelop.Internal.Project;
using ICSharpCode.SharpDevelop.BrowserDisplayBinding;
namespace ICSharpCode.SharpDevelop.Gui.Dialogs
{
public class AddWebReferenceDialog : System.Windows.Forms.Form
{
private System.ComponentModel.IContainer components;
private System.Windows.Forms.ListView webServicePropertiesListView;
private System.Windows.Forms.Panel bottomPanel;
private System.Windows.Forms.Splitter splitter;
private System.Windows.Forms.Label urlLabel;
private System.Windows.Forms.Button forwardButton;
private System.Windows.Forms.ColumnHeader valueColumnHeader;
private System.Windows.Forms.ComboBox urlComboBox;
private System.Windows.Forms.TextBox referenceNameTextBox;
private System.Windows.Forms.Button abortButton;
private System.Windows.Forms.ImageList tabControlImageList;
private System.Windows.Forms.Button addButton;
private System.Windows.Forms.Label namespaceLabel;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.TabPage wsdlTabPage;
private System.Windows.Forms.TreeView webServicesTreeView;
private System.Windows.Forms.Button goButton;
private System.Windows.Forms.Panel urlPanel;
private System.Windows.Forms.Label referenceNameLabel;
private System.Windows.Forms.ColumnHeader propertyColumnHeader;
private System.Windows.Forms.ImageList webServicesTreeViewImageList;
private System.Windows.Forms.Button refreshButton;
private System.Windows.Forms.TabPage webServicesTabPage;
private System.Windows.Forms.TextBox namespaceTextBox;
private System.Windows.Forms.Button backButton;
private System.Windows.Forms.TabControl tabControl;
private System.Windows.Forms.ToolTip tips;
private AxWebBrowser webBrowser;
IProject project = null;
ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
IMessageService messageService =(IMessageService)ServiceManager.Services.GetService(typeof(IMessageService));
DiscoveryClientProtocol discoveryClientProtocol = null;
delegate DiscoveryDocument DiscoverAnyAsync(string url);
delegate void DisplayWebServiceHandler(ServiceDescription desc);
ArrayList referenceInformations = new ArrayList();
public ArrayList ReferenceInformations
{
get {
return referenceInformations;
}
}
public AddWebReferenceDialog(IProject p)
{
InitDialog();
WebServicePropertiesListViewResize(null, null);
InitWebBrowser();
InitImages();
InitAutoCompletion();
this.project = p;
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if (disposing) {
if (components != null) {
components.Dispose();
}
}
base.Dispose(disposing);
}
private void InitDialog()
{
this.components = new System.ComponentModel.Container();
this.tips = new System.Windows.Forms.ToolTip(this.components);
this.tabControl = new System.Windows.Forms.TabControl();
this.backButton = new System.Windows.Forms.Button();
this.namespaceTextBox = new System.Windows.Forms.TextBox();
this.webServicesTabPage = new System.Windows.Forms.TabPage();
this.refreshButton = new System.Windows.Forms.Button();
this.webServicesTreeViewImageList = new System.Windows.Forms.ImageList(this.components);
this.propertyColumnHeader = new System.Windows.Forms.ColumnHeader();
this.referenceNameLabel = new System.Windows.Forms.Label();
this.urlPanel = new System.Windows.Forms.Panel();
this.goButton = new System.Windows.Forms.Button();
this.webServicesTreeView = new System.Windows.Forms.TreeView();
this.wsdlTabPage = new System.Windows.Forms.TabPage();
this.cancelButton = new System.Windows.Forms.Button();
this.namespaceLabel = new System.Windows.Forms.Label();
this.addButton = new System.Windows.Forms.Button();
this.tabControlImageList = new System.Windows.Forms.ImageList(this.components);
this.abortButton = new System.Windows.Forms.Button();
this.referenceNameTextBox = new System.Windows.Forms.TextBox();
this.urlComboBox = new System.Windows.Forms.ComboBox();
this.valueColumnHeader = new System.Windows.Forms.ColumnHeader();
this.forwardButton = new System.Windows.Forms.Button();
this.urlLabel = new System.Windows.Forms.Label();
this.splitter = new System.Windows.Forms.Splitter();
this.bottomPanel = new System.Windows.Forms.Panel();
this.webServicePropertiesListView = new System.Windows.Forms.ListView();
this.tabControl.SuspendLayout();
this.webServicesTabPage.SuspendLayout();
this.urlPanel.SuspendLayout();
this.bottomPanel.SuspendLayout();
this.SuspendLayout();
//
// tabControl
//
this.tabControl.Controls.Add(this.wsdlTabPage);
this.tabControl.Controls.Add(this.webServicesTabPage);
this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl.ImageList = this.tabControlImageList;
this.tabControl.Location = new System.Drawing.Point(0, 32);
this.tabControl.Name = "tabControl";
this.tabControl.SelectedIndex = 0;
this.tabControl.Size = new System.Drawing.Size(722, 371);
this.tabControl.TabIndex = 1;
//
// backButton
//
this.backButton.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.backButton.Location = new System.Drawing.Point(4, 4);
this.backButton.Name = "backButton";
this.backButton.Size = new System.Drawing.Size(28, 24);
this.backButton.TabIndex = 3;
this.tips.SetToolTip(this.backButton, resourceService.GetString("ICSharpCode.SharpDevelop.Gui.Dialogs.AddWebReferenceDialog.BackButtonTooltip"));
this.backButton.Click += new System.EventHandler(this.BackButtonClick);
//
// namespaceTextBox
//
this.namespaceTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.namespaceTextBox.Location = new System.Drawing.Point(144, 32);
this.namespaceTextBox.Name = "namespaceTextBox";
this.namespaceTextBox.Size = new System.Drawing.Size(472, 21);
this.namespaceTextBox.TabIndex = 3;
this.namespaceTextBox.Text = "";
//
// webServicesTabPage
//
this.webServicesTabPage.BackColor = System.Drawing.Color.White;
this.webServicesTabPage.Controls.Add(this.webServicePropertiesListView);
this.webServicesTabPage.Controls.Add(this.splitter);
this.webServicesTabPage.Controls.Add(this.webServicesTreeView);
this.webServicesTabPage.ImageIndex = 0;
this.webServicesTabPage.Location = new System.Drawing.Point(4, 23);
this.webServicesTabPage.Name = "webServicesTabPage";
this.webServicesTabPage.Size = new System.Drawing.Size(714, 344);
this.webServicesTabPage.TabIndex = 1;
this.webServicesTabPage.Text = resourceService.GetString("ICSharpCode.SharpDevelop.Gui.Dialogs.AddWebReferenceDialog.WebServicesTabPageTitle");
//
// refreshButton
//
this.refreshButton.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.refreshButton.Location = new System.Drawing.Point(88, 4);
this.refreshButton.Name = "refreshButton";
this.refreshButton.Size = new System.Drawing.Size(28, 24);
this.refreshButton.TabIndex = 6;
this.tips.SetToolTip(this.refreshButton, resourceService.GetString("ICSharpCode.SharpDevelop.Gui.Dialogs.AddWebReferenceDialog.RefreshButtonTooltip"));
this.refreshButton.Click += new System.EventHandler(this.RefreshButtonClick);
//
// webServicesTreeViewImageList
//
this.webServicesTreeViewImageList.ImageSize = new System.Drawing.Size(16, 16);
this.webServicesTreeViewImageList.TransparentColor = System.Drawing.Color.Transparent;
//
// propertyColumnHeader
//
this.propertyColumnHeader.Text = resourceService.GetString("ICSharpCode.SharpDevelop.Gui.Dialogs.AddWebReferenceDialog.PropertyColumnHeader");
this.propertyColumnHeader.Width = 209;
//
// referenceNameLabel
//
this.referenceNameLabel.Location = new System.Drawing.Point(8, 8);
this.referenceNameLabel.Name = "referenceNameLabel";
this.referenceNameLabel.Size = new System.Drawing.Size(112, 16);
this.referenceNameLabel.TabIndex = 0;
this.referenceNameLabel.Text = resourceService.GetString("ICSharpCode.SharpDevelop.Gui.Dialogs.AddWebReferenceDialog.ReferenceNameLabel");
//
// urlPanel
//
this.urlPanel.Controls.Add(this.urlComboBox);
this.urlPanel.Controls.Add(this.urlLabel);
this.urlPanel.Controls.Add(this.goButton);
this.urlPanel.Controls.Add(this.refreshButton);
this.urlPanel.Controls.Add(this.abortButton);
this.urlPanel.Controls.Add(this.forwardButton);
this.urlPanel.Controls.Add(this.backButton);
this.urlPanel.Dock = System.Windows.Forms.DockStyle.Top;
this.urlPanel.Location = new System.Drawing.Point(0, 0);
this.urlPanel.Name = "urlPanel";
this.urlPanel.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.urlPanel.Size = new System.Drawing.Size(722, 32);
this.urlPanel.TabIndex = 0;
//
// goButton
//
this.goButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.goButton.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.goButton.Location = new System.Drawing.Point(690, 4);
this.goButton.Name = "goButton";
this.goButton.Size = new System.Drawing.Size(28, 24);
this.goButton.TabIndex = 2;
this.tips.SetToolTip(this.goButton, resourceService.GetString("ICSharpCode.SharpDevelop.Gui.Dialogs.AddWebReferenceDialog.GoButtonTooltip"));
this.goButton.Click += new System.EventHandler(this.GoButtonClick);
//
// webServicesTreeView
//
this.webServicesTreeView.Dock = System.Windows.Forms.DockStyle.Left;
this.webServicesTreeView.HotTracking = true;
this.webServicesTreeView.ImageList = this.webServicesTreeViewImageList;
this.webServicesTreeView.Location = new System.Drawing.Point(0, 0);
this.webServicesTreeView.Name = "webServicesTreeView";
this.webServicesTreeView.ShowRootLines = false;
this.webServicesTreeView.Size = new System.Drawing.Size(280, 344);
this.webServicesTreeView.TabIndex = 0;
this.webServicesTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.WebServicesTreeViewAfterSelect);
//
// wsdlTabPage
//
this.wsdlTabPage.ImageIndex = 1;
this.wsdlTabPage.Location = new System.Drawing.Point(4, 23);
this.wsdlTabPage.Name = "wsdlTabPage";
this.wsdlTabPage.Size = new System.Drawing.Size(714, 344);
this.wsdlTabPage.TabIndex = 0;
this.wsdlTabPage.Text = "WSDL";
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.cancelButton.Location = new System.Drawing.Point(632, 32);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(80, 23);
this.cancelButton.TabIndex = 5;
this.cancelButton.Text = resourceService.GetString("Global.CancelButtonText");
this.cancelButton.Click += new System.EventHandler(this.CancelButtonClick);
//
// namespaceLabel
//
this.namespaceLabel.Location = new System.Drawing.Point(8, 32);
this.namespaceLabel.Name = "namespaceLabel";
this.namespaceLabel.Size = new System.Drawing.Size(112, 16);
this.namespaceLabel.TabIndex = 1;
this.namespaceLabel.Text = resourceService.GetString("ICSharpCode.SharpDevelop.Gui.Dialogs.AddWebReferenceDialog.NamespaceLabel");
//
// addButton
//
this.addButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.addButton.Enabled = false;
this.addButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.addButton.Location = new System.Drawing.Point(632, 8);
this.addButton.Name = "addButton";
this.addButton.Size = new System.Drawing.Size(80, 23);
this.addButton.TabIndex = 4;
this.addButton.Text = resourceService.GetString("Global.AddButtonText");
this.addButton.Click += new System.EventHandler(this.AddButtonClick);
//
// tabControlImageList
//
this.tabControlImageList.ImageSize = new System.Drawing.Size(16, 16);
this.tabControlImageList.TransparentColor = System.Drawing.Color.Transparent;
//
// abortButton
//
this.abortButton.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.abortButton.Location = new System.Drawing.Point(60, 4);
this.abortButton.Name = "abortButton";
this.abortButton.Size = new System.Drawing.Size(28, 24);
this.abortButton.TabIndex = 5;
this.tips.SetToolTip(this.abortButton, resourceService.GetString("ICSharpCode.SharpDevelop.Gui.Dialogs.AddWebReferenceDialog.StopButtonTooltip"));
this.abortButton.Click += new System.EventHandler(this.AbortButtonClick);
//
// referenceNameTextBox
//
this.referenceNameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.referenceNameTextBox.Location = new System.Drawing.Point(144, 8);
this.referenceNameTextBox.Name = "referenceNameTextBox";
this.referenceNameTextBox.Size = new System.Drawing.Size(472, 21);
this.referenceNameTextBox.TabIndex = 2;
this.referenceNameTextBox.Text = "";
//
// urlComboBox
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -