Exemple #1
0
        private void mnuItemEdit_Click(object sender, EventArgs e)
        {
            var listItem = lvwItems.SelectedItems[0];
            var item = (Item)listItem.Tag;

            var editItemForm = new frmAddEditItem();
            editItemForm.Item = item;
            editItemForm.ShowEdit();

            if (editItemForm.DialogResult == DialogResult.Cancel)
                return;

            SetItem(listItem, item);

            OnSelectedItemChanged();

            _isDirty = true;
        }
Exemple #2
0
        private void mnuItemAdd_Click(object sender, EventArgs e)
        {
            var addItemForm = new frmAddEditItem();
            addItemForm.ShowAdd();

            if (addItemForm.DialogResult == DialogResult.Cancel)
                return;

            ((Folder)tvwFolders.SelectedNode.Tag).Items.Add(addItemForm.Item);

            lvwItems.Select();
            AddListItem(addItemForm.Item, true);

            _isDirty = true;
        }