示例#1
0
        /// <summary>
        /// We will attempt to bring up more information about the double-clicked item
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">Event arguments</param>
        private void listView1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (listView1.SelectedItems.Count == 0)
            {
                return;
            }

            var item = listView1.SelectedItems[0];
            var info = item.Tag as ServiceInfoWrapper;

            if (info == null)
            {
                MessageBox.Show("No action is associated with the selected service host.");
                return;
            }

            switch (info.Protocol.ToLower())
            {
            case "http-get":
                Process.Start(info.Url);
                break;

            case "rest http (xml)":
            case "rest http (json)":
            case "basic http":
            case "ws http":
            case "net.tcp":
                var dlg = new ServiceTestHarness();
                dlg.ShowService(info);
                dlg.Show();
                break;

            default:
                MessageBox.Show("No action is associated with this type of service host (" + info.Protocol + ").");
                break;
            }
        }
示例#2
0
        /// <summary>
        /// We will attempt to bring up more information about the double-clicked item
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">Event arguments</param>
        private void listView1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (listView1.SelectedItems.Count == 0) return;

            var item = listView1.SelectedItems[0];
            var info = item.Tag as ServiceInfoWrapper;
            if (info == null)
            {
                MessageBox.Show("No action is associated with the selected service host.");
                return;
            }

            switch (info.Protocol.ToLower())
            {
                case "http-get":
                    Process.Start(info.Url);
                    break;
                case "rest http (xml)":
                case "rest http (json)":
                case "basic http":
                case "ws http":
                case "net.tcp":
                    var dlg = new ServiceTestHarness();
                    dlg.ShowService(info);
                    dlg.Show();
                    break;
                default:
                    MessageBox.Show("No action is associated with this type of service host (" + info.Protocol + ").");
                    break;
            }
        }