Exemplo n.º 1
0
        private static bool CheckIfAlreadyPerformed()
        {
            bool Result = true;

            Result &= CertificateStore.IsCertificateInstalled(CertificateRoot);
            Result &= CertificateStore.IsCertificateInstalled(CertificateClass3);

            return(Result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Called when the user clicks the 'Yes' button.
        /// </summary>
        /// <param name="sender">The object that raised the event.</param>
        /// <param name="e">The event data.</param>
        private void OnYes(object sender, ExecutedRoutedEventArgs e)
        {
            StatusWindow Dlg = new StatusWindow();

            Certificate CertificateRoot   = App.CertificateRoot;
            Certificate CertificateClass3 = App.CertificateClass3;
            bool        Success           = CertificateStore.InstallCertificates(new Certificate[] { CertificateRoot, CertificateClass3 });

            Dlg.Success = Success;
            Dlg.Owner   = this;
            Dlg.ShowDialog();

            if (Success)
            {
                App.SetOperationSuccessful();
            }

            Close();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindow"/> class.
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();
            DataContext = this;

            if (App.IsCommandLineValid)
            {
                if (App.IsInstallation)
                {
                    if (App.IsAlreadyPerformed)
                    {
                        CloseNow();
                    }
                }
                else
                {
                    if (App.IsAlreadyPerformed)
                    {
                        Certificate CertificateRoot   = App.CertificateRoot;
                        Certificate CertificateClass3 = App.CertificateClass3;
                        bool        Success           = CertificateStore.UninstallCertificates(new Certificate[] { CertificateRoot, CertificateClass3 });

                        if (Success)
                        {
                            App.SetOperationSuccessful();
                        }
                    }

                    CloseNow();
                }
            }
            else
            {
                CloseNow();
            }
        }