⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uddiexplorerform.cs

📁 In the previous article, we presented an approach for capturing similarity between words that was co
💻 CS
📖 第 1 页 / 共 3 页
字号:
#region header documentation
/****************************************************************************
*	(c) Copyright Dao Ngoc Thanh $ Email: thanh.dao@gmx.net, dnt_box@yahoo.com.au, 2005. All rights reserved.
*	
*****************************************************************************
*
*	File:	
*
*	Purpose:	 
*
*	 $Logfile: 
*	$Revision: 1 $
*	    
*	  $Author: Dao Ngoc Thanh
*
****************************************************************************/
#endregion

using System;
using System.Reflection;
using System.Windows.Forms;
using System.Net;
using System.Text.RegularExpressions;
using System.Threading;
using Microsoft.Uddi;
using Microsoft.Uddi.Business;
using Microsoft.Uddi.Service;
using Microsoft.Uddi.Binding;
using Microsoft.Uddi.ServiceType;
using Microsoft.Uddi.Api;
using WSDLParser;
using System.Collections;
using ServiceRanking;


namespace UDDI_Explorer
{
	/// <summary>
	/// Summary description for UDDIExplorerForm.
	/// </summary>
	/// 	

	internal class UDDIExplorerForm : System.Windows.Forms.Form
	{
		internal static UDDIServiceList SelectedServiceList;		
		#region data
		private System.ComponentModel.IContainer components;
		private System.Windows.Forms.Button btnAddSelect;
		private System.Windows.Forms.Button btnCancel;
		private ComboBox cboInquireUrl;
		private Regex regexURL;
		private Thread _thread;
		private ThreadStart _threadStart;

		private System.Windows.Forms.ImageList tvImageList;				
		private System.Windows.Forms.GroupBox groupBox2;
		private System.Windows.Forms.Label label2;
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.CheckBox chkSensitive;
		private System.Windows.Forms.CheckBox chkExactMatch;
		private System.Windows.Forms.Button btnHelp;
		private System.Windows.Forms.Label label6;
		private System.Windows.Forms.TextBox txtTModelKeys;
		private System.Windows.Forms.Label label5;
		private System.Windows.Forms.TextBox txtBusinessKey;
		private System.Windows.Forms.Label label1;
		private System.Windows.Forms.TextBox name;
		private System.Windows.Forms.Button searchButton;
		private System.Windows.Forms.TreeView tvwSearchResults;
		private System.Windows.Forms.Label label3;

		private NameCollection _keywords;
		private StringCollection _tModelKeys;
		private FindQualifierCollection _qualifiers;
        private ImageList imageList1;		
		private string _uddiServerURL;
        private Button btnPostFilter;
        private CheckBox chkORAllKeys;
        private ContextMenuStrip contextMenuStrip1;
        private ToolStripMenuItem toolStripMenuItem1;

        private ToolTip toolTip1; 

		#endregion

		/// <summary>
		/// 
		/// </summary>
		private void Save_Settings()
		{			
			if (cboInquireUrl.SelectedIndex != 0 && cboInquireUrl.SelectedItem != null )
			{
				string text=cboInquireUrl.SelectedItem.ToString() ;
				cboInquireUrl.Items.Remove(cboInquireUrl.SelectedItem) ;
				cboInquireUrl.Items.Insert(0, text) ;
				cboInquireUrl.SelectedIndex=0 ;
			}			
			
		}

		/// <summary>
		/// Load settings/data saved to the app config file
		/// </summary>
		private void Load_Settings()
		{
			
			//otherwise add default items
			if ( cboInquireUrl.Items.Count == 0)
			{
                cboInquireUrl.Items.Add("http://uddi.microsoft.com/inquire");
				cboInquireUrl.Items.Add("http://www.xmethods.net/inquire");
				cboInquireUrl.Items.Add("http://uddi.ibm.com/ubr/inquiryapi");							
				cboInquireUrl.Items.Add("http://uddi.ibm.com/testregistry/inquiryapi");
				cboInquireUrl.SelectedIndex=0;											
			};

		}


		private void MyInit()
		{
			
			SelectedServiceList=null;			
			tvwSearchResults.CheckBoxes=false;

            this.toolTip1 = new System.Windows.Forms.ToolTip();
            this.toolTip1.InitialDelay = 300; //half a second delay 
            this.toolTip1.ReshowDelay = 0; 

						
			cboInquireUrl=new ComboBox ();			
			this.cboInquireUrl.DropDownWidth=280;
			this.cboInquireUrl.Location=new System.Drawing.Point(16, 40);
			this.cboInquireUrl.Name="cboInquireUrl";
			this.cboInquireUrl.Size=new System.Drawing.Size(320, 21);
			this.cboInquireUrl.TabIndex=0;						
			
			
			cboInquireUrl.Visible=true;			
			this.groupBox2.Controls.Add (cboInquireUrl);

			Load_Settings();
					
			
			btnAddSelect.Enabled=false;
            btnPostFilter.Enabled=false;
			
			//@"^(http|ftp)://(www\.)?.+\.(com|net|org)$"
			regexURL=new Regex(@"^(http|ftp)://");
		}

			
		public UDDIExplorerForm()
		{
			InitializeComponent();
			MyInit();
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UDDIExplorerForm));
            this.tvImageList = new System.Windows.Forms.ImageList(this.components);
            this.btnCancel = new System.Windows.Forms.Button();
            this.btnAddSelect = new System.Windows.Forms.Button();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.label2 = new System.Windows.Forms.Label();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.chkORAllKeys = new System.Windows.Forms.CheckBox();
            this.btnPostFilter = new System.Windows.Forms.Button();
            this.chkSensitive = new System.Windows.Forms.CheckBox();
            this.chkExactMatch = new System.Windows.Forms.CheckBox();
            this.btnHelp = new System.Windows.Forms.Button();
            this.label6 = new System.Windows.Forms.Label();
            this.txtTModelKeys = new System.Windows.Forms.TextBox();
            this.label5 = new System.Windows.Forms.Label();
            this.txtBusinessKey = new System.Windows.Forms.TextBox();
            this.label1 = new System.Windows.Forms.Label();
            this.name = new System.Windows.Forms.TextBox();
            this.searchButton = new System.Windows.Forms.Button();
            this.tvwSearchResults = new System.Windows.Forms.TreeView();
            this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
            this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
            this.label3 = new System.Windows.Forms.Label();
            this.imageList1 = new System.Windows.Forms.ImageList(this.components);
            this.groupBox2.SuspendLayout();
            this.groupBox1.SuspendLayout();
            this.contextMenuStrip1.SuspendLayout();
            this.SuspendLayout();
            // 
            // tvImageList
            // 
            this.tvImageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("tvImageList.ImageStream")));
            this.tvImageList.TransparentColor = System.Drawing.Color.Transparent;
            this.tvImageList.Images.SetKeyName(0, "");
            this.tvImageList.Images.SetKeyName(1, "");
            this.tvImageList.Images.SetKeyName(2, "");
            this.tvImageList.Images.SetKeyName(3, "");
            this.tvImageList.Images.SetKeyName(4, "");
            this.tvImageList.Images.SetKeyName(5, "");
            this.tvImageList.Images.SetKeyName(6, "");
            this.tvImageList.Images.SetKeyName(7, "site_icon.gif");
            this.tvImageList.Images.SetKeyName(8, "");
            this.tvImageList.Images.SetKeyName(9, "");
            this.tvImageList.Images.SetKeyName(10, "");
            this.tvImageList.Images.SetKeyName(11, "");
            this.tvImageList.Images.SetKeyName(12, "");
            this.tvImageList.Images.SetKeyName(13, "");
            this.tvImageList.Images.SetKeyName(14, "");
            // 
            // btnCancel
            // 
            this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.btnCancel.Location = new System.Drawing.Point(348, 538);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(104, 24);
            this.btnCancel.TabIndex = 2;
            this.btnCancel.Text = "Close";
            this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
            // 
            // btnAddSelect
            // 
            this.btnAddSelect.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.btnAddSelect.Location = new System.Drawing.Point(237, 538);
            this.btnAddSelect.Name = "btnAddSelect";
            this.btnAddSelect.Size = new System.Drawing.Size(104, 24);
            this.btnAddSelect.TabIndex = 1;
            this.btnAddSelect.Text = "Add Selection(s)";
            this.btnAddSelect.Visible = false;
            this.btnAddSelect.Click += new System.EventHandler(this.btnAddSelect_Click);
            // 
            // groupBox2
            // 
            this.groupBox2.Controls.Add(this.label2);
            this.groupBox2.ForeColor = System.Drawing.SystemColors.Highlight;
            this.groupBox2.Location = new System.Drawing.Point(5, 9);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(448, 80);
            this.groupBox2.TabIndex = 6;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "UDDI Registry Location";
            // 
            // label2
            // 
            this.label2.ForeColor = System.Drawing.SystemColors.ControlText;
            this.label2.Location = new System.Drawing.Point(16, 24);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(280, 16);
            this.label2.TabIndex = 0;
            this.label2.Text = "URL:";
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.chkORAllKeys);
            this.groupBox1.Controls.Add(this.btnPostFilter);
            this.groupBox1.Controls.Add(this.chkSensitive);
            this.groupBox1.Controls.Add(this.chkExactMatch);
            this.groupBox1.Controls.Add(this.btnHelp);
            this.groupBox1.Controls.Add(this.label6);
            this.groupBox1.Controls.Add(this.txtTModelKeys);
            this.groupBox1.Controls.Add(this.label5);
            this.groupBox1.Controls.Add(this.txtBusinessKey);
            this.groupBox1.Controls.Add(this.label1);
            this.groupBox1.Controls.Add(this.name);
            this.groupBox1.Controls.Add(this.searchButton);
            this.groupBox1.ForeColor = System.Drawing.SystemColors.Highlight;
            this.groupBox1.Location = new System.Drawing.Point(5, 97);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(448, 168);
            this.groupBox1.TabIndex = 5;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Search Parameters";
            // 
            // chkORAllKeys
            // 
            this.chkORAllKeys.AutoSize = true;
            this.chkORAllKeys.Checked = true;
            this.chkORAllKeys.CheckState = System.Windows.Forms.CheckState.Checked;
            this.chkORAllKeys.Location = new System.Drawing.Point(259, 111);
            this.chkORAllKeys.Name = "chkORAllKeys";
            this.chkORAllKeys.Size = new System.Drawing.Size(106, 17);
            this.chkORAllKeys.TabIndex = 14;
            this.chkORAllKeys.Text = "OR all key words";
            this.chkORAllKeys.UseVisualStyleBackColor = true;
            // 
            // btnPostFilter
            // 
            this.btnPostFilter.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.btnPostFilter.Location = new System.Drawing.Point(16, 133);
            this.btnPostFilter.Name = "btnPostFilter";
            this.btnPostFilter.Size = new System.Drawing.Size(73, 24);
            this.btnPostFilter.TabIndex = 8;
            this.btnPostFilter.Text = "Filter";
            this.btnPostFilter.UseVisualStyleBackColor = true;
            this.btnPostFilter.Click += new System.EventHandler(this.btnPostFilter_Click);
            // 
            // chkSensitive
            // 
            this.chkSensitive.Location = new System.Drawing.Point(16, 112);
            this.chkSensitive.Name = "chkSensitive";
            this.chkSensitive.Size = new System.Drawing.Size(112, 16);
            this.chkSensitive.TabIndex = 13;
            this.chkSensitive.Text = "Case sensitive";
            // 
            // chkExactMatch
            // 
            this.chkExactMatch.Location = new System.Drawing.Point(136, 108);
            this.chkExactMatch.Name = "chkExactMatch";
            this.chkExactMatch.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.chkExactMatch.Size = new System.Drawing.Size(104, 24);
            this.chkExactMatch.TabIndex = 12;
            this.chkExactMatch.Text = "Exact match";
            // 
            // btnHelp
            // 
            this.btnHelp.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.btnHelp.ForeColor = System.Drawing.SystemColors.ControlText;
            this.btnHelp.Location = new System.Drawing.Point(360, 134);
            this.btnHelp.Name = "btnHelp";
            this.btnHelp.Size = new System.Drawing.Size(72, 24);
            this.btnHelp.TabIndex = 6;
            this.btnHelp.Text = "Help";
            this.btnHelp.Click += new System.EventHandler(this.btnHelp_Click);
            // 
            // label6
            // 
            this.label6.ForeColor = System.Drawing.SystemColors.ControlText;
            this.label6.Location = new System.Drawing.Point(256, 21);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(144, 13);
            this.label6.TabIndex = 11;
            this.label6.Text = "Compliance TModel name :";
            // 
            // txtTModelKeys
            // 
            this.txtTModelKeys.Location = new System.Drawing.Point(256, 37);
            this.txtTModelKeys.Name = "txtTModelKeys";
            this.txtTModelKeys.Size = new System.Drawing.Size(176, 20);
            this.txtTModelKeys.TabIndex = 1;
            // 
            // label5
            // 
            this.label5.ForeColor = System.Drawing.SystemColors.ControlText;
            this.label5.Location = new System.Drawing.Point(16, 21);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(136, 13);
            this.label5.TabIndex = 9;
            this.label5.Text = "Business provider name :";
            // 
            // txtBusinessKey
            // 
            this.txtBusinessKey.Location = new System.Drawing.Point(16, 37);
            this.txtBusinessKey.Name = "txtBusinessKey";
            this.txtBusinessKey.Size = new System.Drawing.Size(232, 20);
            this.txtBusinessKey.TabIndex = 0;
            // 
            // label1
            // 
            this.label1.ForeColor = System.Drawing.SystemColors.ControlText;
            this.label1.Location = new System.Drawing.Point(16, 69);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(272, 16);
            this.label1.TabIndex = 3;
            this.label1.Text = "Web service name :";
            // 
            // name
            // 
            this.name.Location = new System.Drawing.Point(16, 85);
            this.name.Name = "name";
            this.name.Size = new System.Drawing.Size(416, 20);
            this.name.TabIndex = 2;
            this.name.TextChanged += new System.EventHandler(this.name_TextChanged);
            this.name.KeyDown += new System.Windows.Forms.KeyEventHandler(this.name_KeyDown);
            // 
            // searchButton
            // 
            this.searchButton.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.searchButton.ForeColor = System.Drawing.SystemColors.ControlText;
            this.searchButton.Location = new System.Drawing.Point(282, 134);
            this.searchButton.Name = "searchButton";
            this.searchButton.Size = new System.Drawing.Size(72, 24);
            this.searchButton.TabIndex = 5;
            this.searchButton.Text = "&Search";
            this.searchButton.Click += new System.EventHandler(this.searchButton_Click);
            // 
            // tvwSearchResults
            // 
            this.tvwSearchResults.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(212)))), ((int)(((byte)(208)))), ((int)(((byte)(200)))));
            this.tvwSearchResults.ContextMenuStrip = this.contextMenuStrip1;
            this.tvwSearchResults.ForeColor = System.Drawing.SystemColors.Highlight;
            this.tvwSearchResults.ImageIndex = 0;
            this.tvwSearchResults.ImageList = this.tvImageList;
            this.tvwSearchResults.LabelEdit = true;
            this.tvwSearchResults.Location = new System.Drawing.Point(5, 289);
            this.tvwSearchResults.Name = "tvwSearchResults";
            this.tvwSearchResults.SelectedImageIndex = 0;
            this.tvwSearchResults.Size = new System.Drawing.Size(448, 231);
            this.tvwSearchResults.TabIndex = 4;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -