1 /* ****************************************************************************
\r
3 * Copyright (c) Microsoft Corporation. All rights reserved.
\r
5 * This software is subject to the Microsoft Public License (Ms-PL).
\r
6 * A copy of the license can be found in the license.htm file included
\r
7 * in this distribution.
\r
9 * You must not remove this notice, or any other, from this software.
\r
11 * ***************************************************************************/
\r
13 namespace System.Web.Mvc {
\r
14 using System.Collections;
\r
16 using System.Web.Compilation;
\r
18 internal sealed class BuildManagerWrapper : IBuildManager {
\r
19 private static readonly Func<string, Stream> _readCachedFileDelegate =
\r
20 TypeHelpers.CreateDelegate<Func<string, Stream>>(typeof(BuildManager), "ReadCachedFile", null /* thisParameter */);
\r
21 private static readonly Func<string, Stream> _createCachedFileDelegate =
\r
22 TypeHelpers.CreateDelegate<Func<string, Stream>>(typeof(BuildManager), "CreateCachedFile", null /* thisParameter */);
\r
24 #region IBuildManager Members
\r
25 object IBuildManager.CreateInstanceFromVirtualPath(string virtualPath, Type requiredBaseType) {
\r
26 return BuildManager.CreateInstanceFromVirtualPath(virtualPath, requiredBaseType);
\r
29 ICollection IBuildManager.GetReferencedAssemblies() {
\r
30 return BuildManager.GetReferencedAssemblies();
\r
33 // ASP.NET 4 methods
\r
34 Stream IBuildManager.ReadCachedFile(string fileName) {
\r
35 return (_readCachedFileDelegate != null) ? _readCachedFileDelegate(fileName) : null;
\r
38 Stream IBuildManager.CreateCachedFile(string fileName) {
\r
39 return (_createCachedFileDelegate != null) ? _createCachedFileDelegate(fileName) : null;
\r