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"); } }); } }
public virtual 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(Dn); 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.ShowInformation(VMDirConstants.STAT_OBJ_DEL_SUCC); } else { UIErrorHelper.ShowInformation(VMDirConstants.STAT_BASE_OBJ_DEL_SUCC); } }); } }
public static bool ConfirmOperation (string confirmMessage) { try { ConfirmationDialogController cwc = new ConfirmationDialogController (confirmMessage); nint result = NSApplication.SharedApplication.RunModalForWindow (cwc.Window); if (result == (nint)VMIdentityConstants.DIALOGOK) return true; else return false; } catch (Exception e) { throw e; } }
public override 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(Dn); NSNotificationCenter.DefaultCenter.PostNotificationName("ReloadResultOutlineView", this); UIErrorHelper.ShowInformation(VMDirConstants.STAT_OBJ_DEL_SUCC); }); } }
partial void HandleConnection(NSObject sender) { if (serverNode == null || serverNode.IsLoggedIn == false) { ConnectToServer(server); } else { ConfirmationDialogController cwc = new ConfirmationDialogController("Are you sure?"); nint result = NSApplication.SharedApplication.RunModalForWindow(cwc.Window); if (result == (nint)VMIdentityConstants.DIALOGOK) { CloseConnection(); } } }
public static bool ConfirmOperation(string confirmMessage) { try { ConfirmationDialogController cwc = new ConfirmationDialogController(confirmMessage); nint result = NSApplication.SharedApplication.RunModalForWindow(cwc.Window); if (result == (nint)VMIdentityConstants.DIALOGOK) { return(true); } else { return(false); } } catch (Exception e) { throw e; } }
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"); } }