コード例 #1
0
        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");
                    }
                });
            }
        }
コード例 #2
0
ファイル: DirectoryNode.cs プロジェクト: wfu8/lightwave
        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);
                    }
                });
            }
        }
コード例 #3
0
		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;
			}
		}
コード例 #4
0
        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);
                });
            }
        }
コード例 #5
0
 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();
         }
     }
 }
コード例 #6
0
 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;
     }
 }
コード例 #7
0
 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();
         }
     });
 }
コード例 #8
0
 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");
     }
 }