void ReadConfigFile (XmlReader reader, string fileName)
{
reader.MoveToContent ();
if (reader.NodeType != XmlNodeType.Element || reader.Name != "configuration")
ThrowException ("Configuration file does not have a valid root element", reader);
if (reader.HasAttributes) {
while (reader.MoveToNextAttribute ()) {
if (reader.LocalName == "xmlns") {
rootNamespace = reader.Value;
continue;
}
ThrowException (String.Format ("Unrecognized attribute '{0}' in root element", reader.LocalName), reader);
}
}
reader.MoveToElement ();
if (reader.IsEmptyElement) {
reader.Skip ();
return;
}
reader.ReadStartElement ();
reader.MoveToContent ();
if (reader.LocalName == "configSections") {
if (reader.HasAttributes)
ThrowException ("Unrecognized attribute in <configSections>.", reader);
rootGroup.ReadConfig (this, fileName, reader);
}
rootGroup.ReadRootData (reader, this, true);
}