示例#1
0
        static void ExecutedCreateCertCore(object sender, ExecutedRoutedEventArgs e, Func <NewCertificate> dlgFactory)
        {
            var dlg = dlgFactory();

            dlg.Owner = Window.GetWindow((DependencyObject)e.Source);
            dlg.ShowDialog();

            NotifyCertificateChanged.Execute(dlg.Result, e?.Source as IInputElement);
        }
示例#2
0
 static void HandleDeleteAll(this CommandBindingCollection commandBindings)
 {
     commandBindings.Add(new CommandBinding(DeleteAll, (s, e) =>
     {
         if (CertProvider.RemoveAll())
         {
             NotifyCertificateChanged.Execute(null, e?.Source as IInputElement);
         }
     }));
 }
示例#3
0
 static void HandleDelete(this CommandBindingCollection commandBindings)
 {
     commandBindings.Add(new CommandBinding(Delete,
                                            (s, e) =>
     {
         if (TryGetStringDataContext(e, out var thumbprint))
         {
             var crt = FindCert(thumbprint);
             if (crt != null)
             {
                 crt.DeleteCertificate();
                 NotifyCertificateChanged.Execute(null, e?.Source as IInputElement);
             }
         }
     }, CanExecuteOnlyStringDataContext));
 }