예제 #1
0
        private void pasteContextMenuItem_Click(object sender, EventArgs e)
        {
            IDataObject GrouptoPaste = Clipboard.GetDataObject();
            Group       g            = (Group)GrouptoPaste.GetData("CopiedGroup");

            KeyChainManager.AddGroup(g);
            TreeNode _Node = new TreeNode();

            _Node.Text = g.Name;
            _Node.Tag  = g;
            GroupTreeView.Nodes.Add(_Node);
            GroupTreeView.SelectedNode          = _Node;
            KeyChainManager.KeyChain.IsModified = true;
            invokeGroupModified("Pasted", g);
        }
예제 #2
0
        public void NewGroup()
        {
            ContextManager.SelectedGroup = null;
            GroupAddEditForm g = new GroupAddEditForm(ContextManager.SelectedGroup);

            if (g.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            bool     success = KeyChainManager.AddGroup(g.Group);
            TreeNode _Node   = new TreeNode();

            _Node.Text      = g.Group.Name;
            _Node.Tag       = g.Group;
            _Node.ForeColor = (Color.FromArgb(g.Group.TextColor[0], g.Group.TextColor[1], g.Group.TextColor[2]));
            //take the next 1 line out if professor says to tonight
            GroupTreeView.ForeColor = (Color.FromArgb(g.Group.TextColor[0], g.Group.TextColor[1], g.Group.TextColor[2]));
            GroupTreeView.Nodes.Add(_Node);
            GroupTreeView.SelectedNode          = _Node;
            KeyChainManager.KeyChain.IsModified = true;

            invokeGroupModified("Added", g.Group);
        }