void FillGridView()
{
dgRules.Rows.Clear();
XmlDocument xml = new XmlDocument();
xml.Load("RegexRules.xml");
XmlElement node = xml.DocumentElement;
dgRules.Rows.Add(node.ChildNodes.Count - 1);
int i = 0;
foreach (XmlNode item in node.ChildNodes)
{
dicRegexRule[item.Attributes["name"].InnerText] = new RegexRule(item.Attributes["from"].InnerText, item.Attributes["to"].InnerText);
dgRules.Rows[i].Cells[0].Value = item.Attributes["from"].InnerText;
dgRules.Rows[i].Cells[1].Value = item.Attributes["to"].InnerText;
i++;
}
}