private void LoadCategories(XDocument p_docCategories)
{
string strVersion = p_docCategories.Element("categoryManager").Attribute("fileVersion").Value;
if (!CURRENT_VERSION.ToString().Equals(strVersion))
throw new Exception(String.Format("Invalid Category Manager version: {0} Expecting {1}", strVersion, CURRENT_VERSION));
XElement xelCategoryList = p_docCategories.Descendants("categoryList").FirstOrDefault();
if (xelCategoryList != null)
{
foreach (XElement xelCategory in xelCategoryList.Elements("category"))
{
string strCategoryPath = xelCategory.Attribute("path").Value;
string strCategoryName = xelCategory.Element("name").Value;
strCategoryPath = Path.Combine(ModInstallDirectory, strCategoryPath);
m_tslCategories.Add(new ModCategory(Convert.ToInt32(xelCategory.Attribute("ID").Value), strCategoryName, strCategoryPath));
}
}
}