private void addRuleButton_Click(object sender, EventArgs e)
        {
            var addRuleDialog = new EditPrintRuleDialog(printRuleDict);
            var result        = addRuleDialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                updateRulesList();
            }
        }
        private void editButton_Click(object sender, EventArgs e)
        {
            if (rulesView.SelectedItems.Count == 0)
            {
                return;
            }
            var selectedRule = rulesView.SelectedItems[0].Tag as PrintRule;

            if (selectedRule == null)
            {
                return;
            }
            var addRuleDialog = new EditPrintRuleDialog(printRuleDict, rulesView.SelectedItems[0].Text, selectedRule);
            var result        = addRuleDialog.ShowDialog();

            if (result == DialogResult.OK)
            {
                updateRulesList();
            }
        }