private TreeNode CreateStringNode(string typeName) { StringTagRule rule = new StringTagRule(); using (StringRuleForm form = new StringRuleForm(SearchRule.StringOpStrings) { Text = "Edit " + typeName + " Tag Rule", }) { if (form.ShowDialog() == DialogResult.OK) { rule.Name = form.TagName; rule.Value = form.TagValue; rule.Operator = form.Operator; } else { return(null); } } TreeNode node = CreateNode(rule); node.Text = rule.NodeDisplay; return(node); }
private void EditStringNode(TreeNode node, StringTagRule rule, string typeName) { using (StringRuleForm form = new StringRuleForm(SearchRule.StringOpStrings) { Text = "Edit " + typeName + " Tag Rule", TagName = rule.Name, TagValue = rule.Value, Operator = rule.Operator, }) { if (form.ShowDialog() == DialogResult.OK) { rule.Name = form.TagName; rule.Value = form.TagValue; rule.Operator = form.Operator; } } node.Text = rule.NodeDisplay; }