コード例 #1
0
        private void Button_Load(object sender, RoutedEventArgs e)
        {
            btnHabilitar.Content = AppBehavior.ProxyEnabled() ? "Desabilitar" : "Habilitar";

            if (AppBehavior.CheckCertificate())
            {
                btnInstalar.Content = "Reinstalar Certificado";
            }
            else
            {
                btnInstalar.Content = "Instalar Certificado";
            }
        }
コード例 #2
0
 private void btnInstalar_Click(object sender, RoutedEventArgs e)
 {
     if (AppBehavior.CheckCertificate())
     {
         MessageBoxResult result = MessageBox.Show("Deseja reinstalar o certificado?", "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question);
         if (result == MessageBoxResult.Yes)
         {
             AppBehavior.InstallCertificate();
             btnInstalar.Content = "Reinstalar Certificado";
         }
     }
     else
     {
         AppBehavior.InstallCertificate();
     }
 }