private void BtnAddRule_Click(object sender, EventArgs e) { var newRule = new Brace.Rule(); inEdit.Rules.Add(newRule); rulesGridView.Rows.Add(CreateRow(newRule)); rulesGridView.ClearSelection(); rulesGridView.Rows[rulesGridView.Rows.Count - 1].Selected = true; rulesGridView.Select(); }
private object[] CreateRow(Brace.Rule rule) { return(new object[] { rule.NotAfterChars, rule.AfterChars, rule.Logic, rule.NotAfterStyles, rule.AfterStyles, rule.Logic, rule.NotBeforeChars, rule.BeforeChars, rule.Logic, rule.NotBeforeStyles, rule.BeforeStyles }); }