private bool verifyConnection(string url) { bool isOk = false; try { using (var svc = new DocumentsClient(DOCUMENT_SERVICE_NAME, this.getServiceEndpointAddress(url, true))) { isOk = svc.IsAlive(); } if (isOk) { using (var svc = new ContentSearchClient(CONTENT_SEARCH_NAME, this.getServiceEndpointAddress(url, false))) { isOk = svc.IsAlive(); } } } catch (Exception ex) { MessageBox.Show(this, "Impossibile stabilire una connessione.", TITOLO, MessageBoxButtons.OK, MessageBoxIcon.Error); } return(isOk); }
public override void GotoNextStep() { this.UseWaitCursor = true; this.Enabled = false; Application.DoEvents(); try { if (this.canProceed()) { Step1.DocumentServiceSourceClient = new DocumentsClient(DOCUMENT_SERVICE_NAME, this.getServiceEndpointAddress(txtUrlSource.Text, true)); Step1.DocumentServiceDestinationClient = new DocumentsClient(DOCUMENT_SERVICE_NAME, this.getServiceEndpointAddress(txtUrlDest.Text, true)); Step1.ContentSearchServiceSourceClient = new ContentSearchClient(CONTENT_SEARCH_NAME, this.getServiceEndpointAddress(txtUrlSource.Text, false)); Step1.ContentSearchServiceDestinationClient = new ContentSearchClient(CONTENT_SEARCH_NAME, this.getServiceEndpointAddress(txtUrlDest.Text, false)); this.UseWaitCursor = false; this.Enabled = true; base.GotoNextStep(); } } catch (Exception ex) { this.UseWaitCursor = false; this.Enabled = true; throw; } }