private void tsbSwitchOrgs_Click(object sender, EventArgs e) { if (AdditionalConnectionDetails.Count > 1) { MessageBox.Show(this, @"Switch can only be performed when no more than one target organization is defined", @"Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } var tempDetail = sourceDetail; sourceDetail = AdditionalConnectionDetails.FirstOrDefault(); ConnectionDetail = AdditionalConnectionDetails.FirstOrDefault(); AdditionalConnectionDetails.Clear(); if (tempDetail != null) { AdditionalConnectionDetails.Add(tempDetail); } mForm.SwitchSourceAndTarget(tempDetail, sourceDetail); if (sourceDetail != null) { sourceService = sourceDetail.GetCrmServiceClient(); base.UpdateConnection(sourceService, sourceDetail, "", null); RetrieveSolutions(); } }
private void MForm_TargetOrganizationRemoved(object sender, TargetOrganizationsEventArgs e) { var toRemove = AdditionalConnectionDetails.FirstOrDefault(c => !e.TargetOrganizations.Contains(c)); RemoveAdditionalOrganization(toRemove); }