Nexus.Client.ModManagement.ReadMeManager.LoadReadMe C# (CSharp) Method

LoadReadMe() public method

Check if the readme setup file is already present.
public LoadReadMe ( ) : void
return void
		public void LoadReadMe()
		{
			string strReadMeManagerPath = ReadMeFilePath;
			if (File.Exists(strReadMeManagerPath))
			{
				XDocument docReadMe = XDocument.Load(strReadMeManagerPath);
				string strVersion = docReadMe.Element("readmeManager").Attribute("fileVersion").Value;
				if (!CURRENT_VERSION.ToString().Equals(strVersion))
					throw new Exception(String.Format("Invalid ReadMe Manager version: {0} Expecting {1}", strVersion, CURRENT_VERSION));

				XElement xelReadMeList = docReadMe.Descendants("readmeList").FirstOrDefault();
				if (xelReadMeList != null)
				{
					foreach (XElement xelReadMe in xelReadMeList.Elements("modFile"))
					{
						string strModName = xelReadMe.Attribute("modName").Value;
						int intFiles = 0;
						string[] strFiles = new string[xelReadMe.Elements("readmeFile").Count()];
						foreach (XElement xelFile in xelReadMe.Elements("readmeFile"))
							strFiles[intFiles++] = xelFile.Attribute("readmeName").Value;

						m_dicReadMeFiles.Add(strModName, strFiles);
					}
				}

				m_booIsInitialized = true;
			}
		}