Esempio n. 1
0
        private void HopsListView_KeyDown(object sender, KeyEventArgs e)
        {
            if (HopsListView.SelectedIndex >= BoilHops.Count() || HopsListView.SelectedIndex < 0)
            {
                return;
            }

            if (Key.Delete == e.Key)
            {
                HopAddition h = (HopAddition)HopsListView.SelectedItem;
                BoilHops.Remove(h);
                recalculateIbu();
            }
        }
Esempio n. 2
0
        private void HopsListView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (HopsListView.SelectedIndex >= BoilHops.Count() || HopsListView.SelectedIndex < 0)
            {
                return;
            }

            var w = new SelectHops(HopsRepo, BoilHops.ToArray()[HopsListView.SelectedIndex]);

            w.ShowDialog();
            if (w.hop != null)
            {
                BoilHops.Remove((HopAddition)HopsListView.SelectedItem);
                hopsCompositionChanged(w.hop);
            }
        }