예제 #1
0
        public void CreateSigningRequest()
        {
            var dto = new CertRequestDTO();
            CreateCertificateWindowController cwc = new CreateCertificateWindowController(dto);

            NSApplication.SharedApplication.BeginSheet(cwc.Window, VMCAAppEnvironment.Instance.MainWindow, () => {
            });
            try {
                nint result = NSApplication.SharedApplication.RunModalForWindow(cwc.Window);
                if (result == (nint)Constants.DIALOGOK)
                {
                    using (var request = new VMCARequest(this.ServerDTO.VMCAClient)) {
                        dto.FillRequest(request);
                        string csr = request.GetCSR(dto.PrivateKey.ToString());
                        this.ServerDTO.SigningRequests.Add(new SigningRequestDTO {
                            CreatedDateTime = DateTime.UtcNow,
                            CSR             = csr
                        });
                        GenericTextViewWindowController gwc = new GenericTextViewWindowController(csr);
                        gwc.Window.Title = "CSR Data";
                        NSApplication.SharedApplication.RunModalForWindow(gwc.Window);
                        NSNotificationCenter.DefaultCenter.PostNotificationName("ReloadTableView", this);
                    }
                }
            } catch (Exception e) {
                UIErrorHelper.ShowAlert(e.Message, "Operation could not complete successfully.");
            } finally {
                VMCAAppEnvironment.Instance.MainWindow.EndSheet(cwc.Window);
                cwc.Dispose();
            }
        }
예제 #2
0
        public static void ShowGenericWindowAsSheet(string content, string title, NSWindow parentWindow)
        {
            UIErrorHelper.CheckedExec(delegate() {
                GenericTextViewWindowController gwc = new GenericTextViewWindowController(content);
                gwc.Window.Title = title;
                NSApplication.SharedApplication.BeginSheet(gwc.Window, parentWindow, () => {
                });

                NSApplication.SharedApplication.RunModalForWindow(gwc.Window);
                parentWindow.EndSheet(gwc.Window);
                gwc.Dispose();
            });
        }
예제 #3
0
        public static void ShowGenericWindowAsSheet (string content, string title, NSWindow parentWindow)
        {
            UIErrorHelper.CheckedExec (delegate () {
                GenericTextViewWindowController gwc = new GenericTextViewWindowController (content);
                gwc.Window.Title = title;
                NSApplication.SharedApplication.BeginSheet (gwc.Window, parentWindow, () => {
                });

                NSApplication.SharedApplication.RunModalForWindow (gwc.Window);
                parentWindow.EndSheet (gwc.Window);
                gwc.Dispose ();
            });
        }