private void ReadConfigSettings() { SetLocaleCode(); if (!SetWorkDir(GetConfigValue(ConfigConsts.WORK_DIR))) { string md5Name = CryptUtils.ComputeHash(GetConfigValue(ConfigConsts.PRODUCT_TITLE), CryptUtils.Hash.MD5); SetWorkDir(Path.Combine(KnownFolders.GetTempFolderSafe(), "Temp\\" + md5Name + "_files\\")); } }
/// <summary> /// Returns a hash code of a specified virtual path. /// </summary> /// <param name="virtualPath">The path to the virtual file.</param> /// <param name="virtualPathDependencies">An array of paths to other virtual resources required by the primary virtual resource.</param> /// <returns>A hash code of the specified virtual file.</returns> public override string GetFileHash(string virtualPath, IEnumerable virtualPathDependencies) { if (base.FileExists(virtualPath)) { return(base.GetFileHash(virtualPath, virtualPathDependencies)); } var parsed = ParsePath(virtualPath); if (parsed.Module == null || parsed.Module.FileSystem == null) { return(null); } using (var content = parsed.Module.FileSystem.GetFile(parsed.ContentPath)) { return(CryptUtils.ComputeHash(content)); } }