Пример #1
0
        private void itemsAddNewItemButton_Click(object sender, EventArgs e)
        {
            var newForm = new AddNewItemForm();

            if (newForm.ShowDialog() == DialogResult.OK)
            {
                AddItemToItemList(newForm.PawsItem);
            }
        }
Пример #2
0
        private void editItemToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (itemsListView.SelectedItems.Count <= 0)
            {
                return;
            }
            var lvItem = itemsListView.SelectedItems[0];

            var editForm = new AddNewItemForm(lvItem.Tag as PawsItem);

            if (editForm.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            lvItem.Text = editForm.PawsItem.Name;

            lvItem.SubItems[1].Text      = editForm.PawsItem.Enabled ? Properties.Resources.SettingsForm_itemsEnableCheckedItemsButton_Click_Enabled : Properties.Resources.SettingsForm_itemsDisableCheckedItemsButton_Click_Disabled;
            lvItem.SubItems[1].BackColor = editForm.PawsItem.Enabled ? Color.DarkGreen : Color.DarkRed;

            lvItem.SubItems[2].Text = editForm.PawsItem.MyState.ToString();
            lvItem.SubItems[3].Text = editForm.PawsItem.GetConditionsDescription();

            lvItem.Tag = editForm.PawsItem;
        }
Пример #3
0
        private void editItemToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (itemsListView.SelectedItems.Count <= 0) return;
            var lvItem = itemsListView.SelectedItems[0];

            var editForm = new AddNewItemForm(lvItem.Tag as PawsItem);

            if (editForm.ShowDialog() != DialogResult.OK) return;
            lvItem.Text = editForm.PawsItem.Name;

            lvItem.SubItems[1].Text = editForm.PawsItem.Enabled ? Properties.Resources.SettingsForm_itemsEnableCheckedItemsButton_Click_Enabled : Properties.Resources.SettingsForm_itemsDisableCheckedItemsButton_Click_Disabled;
            lvItem.SubItems[1].BackColor = editForm.PawsItem.Enabled ? Color.DarkGreen : Color.DarkRed;

            lvItem.SubItems[2].Text = editForm.PawsItem.MyState.ToString();
            lvItem.SubItems[3].Text = editForm.PawsItem.GetConditionsDescription();

            lvItem.Tag = editForm.PawsItem;
        }
Пример #4
0
        private void itemsAddNewItemButton_Click(object sender, EventArgs e)
        {
            var newForm = new AddNewItemForm();

            if (newForm.ShowDialog() == DialogResult.OK)
            {
                AddItemToItemList(newForm.PawsItem);
            }
        }