Nexus.Client.ModManagement.CategoryManager.LoadCategories C# (CSharp) Method

LoadCategories() private method

Loads the data from the category file.
private LoadCategories ( System.Xml.Linq.XDocument p_docCategories ) : void
p_docCategories System.Xml.Linq.XDocument The XML dolcument containing the categories.
return void
		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));
				}
			}
		}

Same methods

CategoryManager::LoadCategories ( string p_strDefaultCategories ) : void