private void btnChangeBufferSize_Click(object sender, EventArgs e) { UIErrorHelper.CheckedExec(delegate { var capacity = TxtBufferSize.IntValue; var message = string.Format("Set superlog buffer size to {0}?", capacity); ConfirmationDialogController cwc = new ConfirmationDialogController (message); nint result = NSApplication.SharedApplication.RunModalForWindow (cwc.Window); if (result == (nint)VMIdentityConstants.DIALOGOK) { SuperLog.setCapacity(Convert.ToUInt32(capacity)); UpdateStatus(); pageSize = capacity; RefreshList(); } }); }
public void OnClickCreateKey (object sender, EventArgs eventargs) { if (KeyLength.SelectedValue != null) { var numKeyLength = KeyLength.SelectedValue.ToString (); var keyPair = VMCAKeyPair.Create (Convert.ToUInt32 (numKeyLength)); PrivateKeyTextView.Value = keyPair.PrivateKey; ConfirmationDialogController dlg = new ConfirmationDialogController ("Do you want to save the Keys?"); //dlg.ConfirmLabel.StringValue = ; int result = (int)NSApplication.SharedApplication.RunModalForWindow (dlg.Window); if (result == Constants.DIALOGOK) VMCAKeyPairNode.SaveKeyData (keyPair); } else { UIErrorHelper.ShowAlert ("", "Please enter a value for Key Length"); } }
public void PerformDelete () { ConfirmationDialogController cwc = new ConfirmationDialogController ("Are you sure?"); nint result = NSApplication.SharedApplication.RunModalForWindow (cwc.Window); if (result == (nint)VMIdentityConstants.DIALOGOK) { UIErrorHelper.CheckedExec (delegate () { ServerDTO.Connection.DeleteObject (Name); ScopeNode node = this.Parent; if (node != null) { node.Children.Remove (this); if (node is DirectoryNode) (node as DirectoryNode).ReloadChildren (); NSNotificationCenter.DefaultCenter.PostNotificationName ("ReloadOutlineView", node); NSNotificationCenter.DefaultCenter.PostNotificationName ("ReloadTableView", node); UIErrorHelper.ShowAlert ("", "Successfully deleted object"); } else { UIErrorHelper.ShowAlert ("", "Deleted base object. Please Refresh the Server"); } }); } }
partial void HandleConnection (NSObject sender) { if (serverNode == null || serverNode.IsLoggedIn == false) { ConnectToServer (null); } else { ConfirmationDialogController cwc = new ConfirmationDialogController ("Are you sure?"); nint result = NSApplication.SharedApplication.RunModalForWindow (cwc.Window); if (result == (nint)VMIdentityConstants.DIALOGOK) { CloseConnection (); } } }