private void LoadXmlLinkFile(string[] cmdparams)
{
//use http://www.hgurl.com/hypergrid.xml for test
try
{
XmlReader r = XmlReader.Create (cmdparams[0]);
XmlConfigSource cs = new XmlConfigSource (r);
string[] excludeSections = null;
if (cmdparams.Length == 2)
{
if (cmdparams[1].ToLower ().StartsWith ("excludelist:"))
{
string excludeString = cmdparams[1].ToLower ();
excludeString = excludeString.Remove (0, 12);
char[] splitter = { ';' };
excludeSections = excludeString.Split (splitter);
}
}
for (int i = 0; i < cs.Configs.Count; i++)
{
bool skip = false;
if ((excludeSections != null) && (excludeSections.Length > 0))
{
for (int n = 0; n < excludeSections.Length; n++)
{
if (excludeSections[n] == cs.Configs[i].Name.ToLower ())
{
skip = true;
break;
}
}
}
if (!skip)
{
ReadLinkFromConfig (cs.Configs[i]);
}
}
}
catch (Exception e)
{
MainConsole.Instance.Error (e.ToString ());
}
}