コード例 #1
0
ファイル: Form1.cs プロジェクト: JesseClarkND/tools
        private void UpdateAllPanelStatus()
        {
            //     SecretariatClient client = new SecretariatClient(WCFClientHelper.HttpBinder, WCFClientHelper.GetEndpointAddress(Settings.WCFServiceAddress, "WCFService.svc"))
            using (SecretariatServiceClient client1 = new SecretariatServiceClient(WCFClientHelper.HttpBinder, WCFClientHelper.GetEndpointAddress(Settings.ServerIP1, SERVICE_NAME)))
            {
                UpdateIPLabel(1, WCFClientHelper.GetEndpointAddress(Settings.ServerIP1, SERVICE_NAME).ToString());

                UpdatePanelStatus(1, client1);
            }

            using (SecretariatServiceClient client2 = new SecretariatServiceClient(WCFClientHelper.HttpBinder, WCFClientHelper.GetEndpointAddress(Settings.ServerIP2, SERVICE_NAME)))
            {
                UpdateIPLabel(2, WCFClientHelper.GetEndpointAddress(Settings.ServerIP2, SERVICE_NAME).ToString());

                UpdatePanelStatus(2, client2);
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: JesseClarkND/tools
        private void _btnStartTestURL2_Click(object sender, EventArgs e)
        {
            UpdateStatusLabel(2, "Started.. Awaiting update");

            Task.Factory.StartNew(() =>
                                  //var thread = new Thread(() =>
            {
                using (SecretariatServiceClient client2 = new SecretariatServiceClient(WCFClientHelper.HttpBinder, WCFClientHelper.GetEndpointAddress(Settings.ServerIP2, SERVICE_NAME)))
                {
                    if (String.IsNullOrEmpty(_txtTestURL2.Text))
                    {
                        MessageBox.Show("Enter a URL to test.");
                        return;
                    }

                    client2.TestURL(_txtTestURL2.Text);
                }
            });

            // thread.Start();
            // thread.Join();
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: JesseClarkND/tools
        //Move these to a control
        #region Panel 1
        private void _btnStartBatch1_Click(object sender, EventArgs e)
        {
            _ddlTestURLBatch1.Enabled = false;
            UpdateStatusLabel(1, "Started.. Awaiting update");

            var thread = new Thread(() =>
            {
                using (SecretariatServiceClient client1 = new SecretariatServiceClient(WCFClientHelper.HttpBinder, WCFClientHelper.GetEndpointAddress(Settings.ServerIP1, SERVICE_NAME)))
                {
                    if (String.IsNullOrEmpty(_txtTestURL1.Text))
                    {
                        MessageBox.Show("Enter a URL to test.");
                        return;
                    }
                    foreach (var item in URLBatchUtility.LoadURLsFromBatch(_ddlTestURLBatch1.SelectedItem.ToString()))
                    {
                        client1.TestURL(item);
                    }
                }
            });


            thread.Start();
            //thread.Join();

            _ddlTestURLBatch1.Enabled = true;;
        }