public async Task UpdatedCachedManagedCertificate(ManagedCertificate managedCertificate, bool reload = false) { var existing = ManagedCertificates.FirstOrDefault(i => i.Id == managedCertificate.Id); var newItem = managedCertificate; // optional reload managed site details (for refresh) if (reload) { newItem = await CertifyClient.GetManagedCertificate(managedCertificate.Id); } if (newItem != null) { newItem.IsChanged = false; // update our cached copy of the managed site details if (existing != null) { var index = ManagedCertificates.IndexOf(existing); ManagedCertificates[index] = newItem; } else { ManagedCertificates.Add(newItem); } } }
public async Task BeginCertificateRequest(string managedItemId, bool resumePaused = true) { //begin request process var managedCertificate = ManagedCertificates.FirstOrDefault(s => s.Id == managedItemId); if (managedCertificate != null) { MainUITabIndex = (int)MainWindow.PrimaryUITabs.CurrentProgress; TrackProgress(managedCertificate); // start request var result = await CertifyClient.BeginCertificateRequest(managedCertificate.Id, resumePaused); } }
public async Task <bool> DeleteManagedCertificate(ManagedCertificate selectedItem) { var existing = ManagedCertificates.FirstOrDefault(s => s.Id == selectedItem.Id); if (existing != null) { if (MessageBox.Show(SR.ManagedCertificateSettings_ConfirmDelete, SR.ConfirmDelete, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK) { existing.Deleted = true; var deletedOK = await CertifyClient.DeleteManagedCertificate(selectedItem.Id); if (deletedOK) { ManagedCertificates.Remove(existing); } return(deletedOK); } } return(false); }