Пример #1
0
        private void ContexMenu_AddItemClicked(object sender, RoutedEventArgs e)
        {
            Dialogs.AddEditCvar dialog = new Dialogs.AddEditCvar();
            var result = dialog.ShowDialog();

            if (result != null && result == true)
            {
                CustomCvarsInstance.Cvars.Add(dialog.ReturnedCvar);
            }
            ListView_Cvars.Items.Refresh();
        }
Пример #2
0
        private void ContexMenu_EditItemClicked(object sender, RoutedEventArgs e)
        {
            if (ListView_Cvars.SelectedItem != null)
            {
                var selectedItemId = ListView_Cvars.SelectedIndex;
                var item           = (SuiBot_Core.Storage.CustomCvar)ListView_Cvars.Items[selectedItemId];

                Dialogs.AddEditCvar dialog = new Dialogs.AddEditCvar(item);
                var result = dialog.ShowDialog();
                if (result != null && result == true)
                {
                    CustomCvarsInstance.Cvars[selectedItemId] = dialog.ReturnedCvar;
                }
                ListView_Cvars.Items.Refresh();
            }
        }