public XmlElement GetAuthElement()
{
XmlHelper h = new XmlHelper("<Authentication />");
h.SetAttribute(".", "Extends", Type.ToString());
if (dgRestrict.Rows.Count > 0 || dgExt.Rows.Count > 0)
h.AddElement(".", "UserInfoProcessors");
if (dgRestrict.Rows.Count > 0)
{
XmlElement xml = h.AddElement("UserInfoProcessors", "Processor");
xml.SetAttribute("Type", "restrict");
XmlHelper xh = new XmlHelper(xml);
foreach (DataGridViewRow row in this.dgRestrict.Rows)
{
XmlElement res = row.Tag as XmlElement;
xh.AddElement(".", res);
}
}
foreach (DataGridViewRow row in this.dgExt.Rows)
{
XmlElement xml = h.AddElement("UserInfoProcessors", "Processor");
xml.SetAttribute("Type", "ExtendProperty");
XmlHelper xh = new XmlHelper(xml);
XmlElement res = row.Tag as XmlElement;
xh.AddElement(".", res);
}
return h.GetElement(".");
}