internal string GetGeneratedSourceFile(VirtualPath virtualPath) { // Add a pending call to make sure our thread doesn't get killed AddPendingCall(); Type codeDomProviderType; CompilerParameters compilerParameters; string generatedFilesDir; try { if (!virtualPath.DirectoryExists()) { throw new ArgumentException(SR.GetString(SR.GetGeneratedSourceFile_Directory_Only, virtualPath.VirtualPathString), "virtualPath"); } // Calls GetCodeDirectoryInformation to ensure the source files are created for the // directory specified by virtualPath GetCodeDirectoryInformation(virtualPath, out codeDomProviderType, out compilerParameters, out generatedFilesDir); return BuildManager.GenerateFileTable[virtualPath.VirtualPathStringNoTrailingSlash]; } finally { RemovePendingCall(); } }
internal string GetGeneratedSourceFile(VirtualPath virtualPath) { string str2; this.AddPendingCall(); try { Type type; CompilerParameters parameters; string str; if (!virtualPath.DirectoryExists()) { throw new ArgumentException(System.Web.SR.GetString("GetGeneratedSourceFile_Directory_Only", new object[] { virtualPath.VirtualPathString }), "virtualPath"); } this.GetCodeDirectoryInformation(virtualPath, out type, out parameters, out str); str2 = BuildManager.GenerateFileTable[virtualPath.VirtualPathStringNoTrailingSlash]; } finally { this.RemovePendingCall(); } return str2; }
private static bool VirtualDirectoryExistsWithAssert(VirtualPath virtualDir) { try { string path = virtualDir.MapPathInternal(); if (path != null) { new FileIOPermission(FileIOPermissionAccess.Read, path).Assert(); } return virtualDir.DirectoryExists(); } catch { return false; } }