示例#1
0
        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);
                }
            }
        }
示例#2
0
        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);
            }
        }
示例#3
0
        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);
        }