Exemple #1
0
        private void ButtonAdd_Click(object sender, RoutedEventArgs e)
        {
            CHub      newitem = new CHub("", 42.5, 42.5, 36, 36, 2.6);
            HubEditor geditor = new HubEditor(this.Title, newitem);

            if (geditor.ShowDialog() != true)
            {
                return;
            }
            data.hublist.Add(newitem);
            ButtonSave.IsEnabled = true;
            LoadData();
        }
Exemple #2
0
        private void ButtonModify_Click(object sender, RoutedEventArgs e)
        {
            if (listBox1.SelectedIndex == -1)
            {
                return;
            }
            HubEditor editor = new HubEditor(this.Title, (CHub)listBox1.SelectedItem);

            if (editor.ShowDialog() == true)
            {
                ButtonSave.IsEnabled = true;
            }
            listBox1.Items.Refresh();
        }