/// <summary> /// Edit an existing item /// </summary> private void cmEditItem_Click(object sender, System.EventArgs e) { if ( SelectedItem != null ) { QuickItem form = new QuickItem(); form.Item = SelectedItem; if ( form.ShowDialog() == DialogResult.OK ) { TreeNode catNode = tCat.SelectedNode; tCat.SelectedNode = null; tCat.SelectedNode = catNode; foreach ( TreeNode t in tItems.Nodes ) { if ( t.Tag as BoxItem == form.Item ) { tItems.SelectedNode = t; break; } } UpdateData(); } } }
/// <summary> /// Create a new item entry /// </summary> private void cmAddItem_Click(object sender, System.EventArgs e) { QuickItem form = new QuickItem(); if ( form.ShowDialog() == DialogResult.OK ) { // Issue 10 - Update the code to Net Framework 3.5 - http://code.google.com/p/pandorasbox3/issues/detail?id=10 - Smjert ( tCat.SelectedNode.Tag as List<object> ).Add( form.Item ); // Issue 10 - End TreeNode catNode = tCat.SelectedNode; tCat.SelectedNode = null; tCat.SelectedNode = catNode; foreach ( TreeNode t in tItems.Nodes ) { if ( t.Tag as BoxItem == form.Item ) { tItems.SelectedNode = t; break; } } UpdateData(); } }