Ejemplo n.º 1
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            var f = new TamperingRuleForm(isRuleNameUsed);

            if (f.ShowDialog(this) == DialogResult.OK)
            {
                var requestTransformation = f.GetRequestTransformation();
                Debug.Assert(!transformations.ContainsKey(requestTransformation.Name));
                lbTamperingRules.Items.Add(requestTransformation.Name);
                transformations.Add(requestTransformation.Name, requestTransformation);
            }
        }
Ejemplo n.º 2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            var selectedIndex = lbTamperingRules.SelectedIndex;

            Debug.Assert(selectedIndex >= 0 && selectedIndex < lbTamperingRules.Items.Count);
            var f = new TamperingRuleForm(transformations[(string)lbTamperingRules.Items[selectedIndex]]);

            if (f.ShowDialog(this) == DialogResult.OK)
            {
                var requestTransformation = f.GetRequestTransformation();
                Debug.Assert(transformations.ContainsKey(requestTransformation.Name));
                transformations[requestTransformation.Name] = requestTransformation;
            }
        }