private void connect_Click(object sender, EventArgs e) { ToggleControl(this.connect, false); UpdateStatus("Connecting..."); GetCrmConnectionHandler gcch = new GetCrmConnectionHandler(BeginGetCrmConnection); AsyncCallback callback = new AsyncCallback(EndGetCrmConnection); gcch.BeginInvoke(this.discourl.Text, callback, gcch); }
private void connect_Click(object sender, EventArgs e) { ToggleControl(this.connect, false); UpdateStatus("Connecting..."); GetCrmConnectionHandler gcch = new GetCrmConnectionHandler(BeginGetCrmConnection); AsyncCallback callback = new AsyncCallback(EndGetCrmConnection); gcch.BeginInvoke(this.discourl.Text, this.uniqueorgname.Text, this.domain.Text, this.username.Text, this.password.Text, callback, gcch); }
private void EndGetCrmConnection(IAsyncResult result) { GetCrmConnectionHandler gcch = result.AsyncState as GetCrmConnectionHandler; IOrganizationService sdk = gcch.EndInvoke(result); ToggleControl(this.connect, true); if (sdk != null) { UpdateStatus("Connected"); this.Sdk = sdk; this.DialogResult = System.Windows.Forms.DialogResult.OK; } }