Example #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);
                }
            }
        }
Example #2
0
        public AppViewModelDesign()
        {
            // create mock registration

            // generate mock data starting point
            GenerateMockData();

            // auto-load data if in WPF designer
            SelectedItem = ManagedCertificates.First();
        }
Example #3
0
        public AppDesignViewModel()
        {
            // create mock registration
            PrimaryContactEmail = "*****@*****.**";

            // generate mock data starting point
            GenerateMockData();

            // auto-load data if in WPF designer
            SelectedItem = ManagedCertificates.First();
        }
Example #4
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);
            }
        }
Example #5
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);
        }