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); }
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); }