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

VerifyReadMeFile() public method

Verifies if the readme file exists in the archive and saves it to the ReadMe folder.
public VerifyReadMeFile ( TxFileManager p_tfmFileManager, string p_strArchivePath ) : bool
p_tfmFileManager ChinhDo.Transactions.TxFileManager
p_strArchivePath string The path to the mod archive.
return bool
		public bool VerifyReadMeFile(TxFileManager p_tfmFileManager, string p_strArchivePath)
		{
			try
			{
				Archive arcFile = new Archive(p_strArchivePath);
				List<string> lstFiles = GetFileList(arcFile, true);
				string strReadMePath = m_strReadMePath;
				string strFileName = String.Empty;
				string strReadMeFile = String.Empty;
				string strModFile = Path.GetFileName(p_strArchivePath);
				string strArchiveFile = Path.GetFileNameWithoutExtension(strModFile) + ".7z";
				byte[] bteData = null;

				PurgeTempFolder();

				for (int i = 0; i < lstFiles.Count; i++)
				{
					strFileName = lstFiles[i].ToString();
					if (Readme.IsValidReadme(strFileName))
					{
						bteData = arcFile.GetFileContents(lstFiles[i]);
						if (bteData.Length > 0)
						{
							strReadMeFile = Path.GetFileName(strFileName);
							strReadMePath = Path.Combine(ReadMeTempPath, strReadMeFile);
							p_tfmFileManager.WriteAllBytes(strReadMePath, bteData);
						}
					}
				}
				string[] strFilesToCompress = Directory.GetFiles(ReadMeTempPath, "*.*", SearchOption.AllDirectories);
				if (strFilesToCompress.Length > 0)
					if (CreateReadMeArchive(strArchiveFile, strFilesToCompress))
					{
						for (int i = 0; i < strFilesToCompress.Length; i++)
						{
							strFilesToCompress[i] = Path.GetFileName(strFilesToCompress[i]);
						}

						m_dicReadMeFiles.Add(Path.GetFileNameWithoutExtension(strArchiveFile), strFilesToCompress);
					}
			}
			catch
			{
				return false;
			}

			return true;
		}