public void AddSecretKey(object sender, EventArgs args) { UIErrorHelper.CheckedExec(delegate() { AddSecretKeyWindowController cwc = new AddSecretKeyWindowController(); NSApplication.SharedApplication.BeginSheet(cwc.Window, VMCertStoreSnapInEnvironment.Instance.mainWindow, () => { }); nint result = NSApplication.SharedApplication.RunModalForWindow(cwc.Window); try { if (result == (nint)VMIdentityConstants.DIALOGOK) { var dto = cwc.SecretKeyDTO; string storeName = (string)Tag; string storePass = ""; using (var session = new VecsStoreSession(ServerNode.ServerDTO.VecsClient, storeName, storePass)) { session.AddSecretKeyEntry(dto.Alias, dto.SecretKey, dto.Password, null); } ServerNode.UpdateStoreInfo(storeName); NSNotificationCenter.DefaultCenter.PostNotificationName("ReloadTableView", this); } } finally { VMCertStoreSnapInEnvironment.Instance.mainWindow.EndSheet(cwc.Window); cwc.Dispose(); } }); }
public void AddSecretKey (object sender, EventArgs args) { UIErrorHelper.CheckedExec (delegate() { AddSecretKeyWindowController cwc = new AddSecretKeyWindowController (); NSApplication.SharedApplication.BeginSheet (cwc.Window, VMCertStoreSnapInEnvironment.Instance.mainWindow, () => { }); nint result = NSApplication.SharedApplication.RunModalForWindow (cwc.Window); try { if (result == (nint)VMIdentityConstants.DIALOGOK) { var dto = cwc.SecretKeyDTO; string storeName = (string)Tag; string storePass = ""; using (var session = new VecsStoreSession (ServerNode.ServerDTO.VecsClient, storeName, storePass)) { session.AddSecretKeyEntry (dto.Alias, dto.SecretKey, dto.Password, null); } ServerNode.UpdateStoreInfo (storeName); NSNotificationCenter.DefaultCenter.PostNotificationName ("ReloadTableView", this); } } finally { VMCertStoreSnapInEnvironment.Instance.mainWindow.EndSheet (cwc.Window); cwc.Dispose (); } }); }