Example #1
0
        private void DeleteRule()
        {
            string choosenRule = RuleComboBox.Text;

            if (choosenRule == "")
            {
                return;
            }
            if (MessageBox.Show("Czy napewno chcesz usunąć tą regułę ?? \n" + RuleComboBox.Text, "Usuwanie", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No, MessageBoxOptions.None) == MessageBoxResult.Yes)
            {
                int index = IndexOfRule(choosenRule);
                if (index != -1)
                {
                    FileAdapter.DeletingRule(baseName, index);
                }
                else
                {
                    MessageBox.Show("Błąd usuwania", "Error", MessageBoxButton.OK, MessageBoxImage.Hand);
                }
            }
        }