예제 #1
0
        private void deleteGroupToolStripMenuItem_Click(object sender, EventArgs e)
        {
            bool  valid;
            Int64?ID = GroupFolders.GetSelectedGroupID(treeAction.SelectedNode, out valid);

            if (valid == false)
            {
                return;
            }
            if (ID == null)
            {
                MessageBox.Show(this, "Cannot delete the Root Group", Program.Title, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (MessageBox.Show(this, "Do you really want to delete the Group " + treeAction.SelectedNode.Text + "?", Program.Title, MessageBoxButtons.YesNo, MessageBoxIcon.Information, MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.No)
            {
                return;
            }
            if (Program.net.DeleteGroup(ID.Value) == false)
            {
                MessageBox.Show(this, "Delete group failed: " + Program.net.GetLastError() + "\nMake sure the group is empty.", Program.Title, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            treeAction.SelectedNode.Parent.Nodes.Remove(treeAction.SelectedNode);
        }
예제 #2
0
        private void refreshGroupToolStripMenuItem_Click(object sender, EventArgs e)
        {
            bool  valid;
            Int64?ID = GroupFolders.GetSelectedGroupID(treeAction.SelectedNode, out valid);

            if (valid == false)
            {
                return;
            }
            GroupFolders.UpdateTreeNode(treeAction.SelectedNode, true);
        }
예제 #3
0
        private void createpolicyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            bool  valid;
            Int64?ID = GroupFolders.GetSelectedGroupID(treeAction.SelectedNode, out valid);

            if (valid == false)
            {
                return;
            }
            frmCreatePolicy frm = new frmCreatePolicy(null, ID);

            if (frm.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
            {
                GroupFolders.UpdateTreeNode(treeAction.SelectedNode, true);
            }
        }
예제 #4
0
        private void renameGroupToolStripMenuItem_Click(object sender, EventArgs e)
        {
            bool  valid;
            Int64?ID = GroupFolders.GetSelectedGroupID(treeAction.SelectedNode, out valid);

            if (valid == false)
            {
                return;
            }
            if (ID == null)
            {
                MessageBox.Show(this, "Cannot rename the Root Group: " + Program.net.GetLastError(), Program.Title, MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            frmCreateGroup frm = new frmCreateGroup(ID, ID == null ? "(Root)" : treeAction.SelectedNode.Text, true);

            if (frm.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
            {
                treeAction.SelectedNode.Text = frm.NewName.Trim();
            }
        }