Exemplo n.º 1
0
        public override CacheDependency GetCacheDependency(string virtualPath, IEnumerable virtualPathDependencies, DateTime utcStart)
        {
            if (EmbeddedViewPath.IsEmbeddedView(virtualPath))
            {
                //TODO: We should actually create a cache dependency file here!

                return(null);
            }
            return(Previous.GetCacheDependency(virtualPath, virtualPathDependencies, utcStart));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Returns the view resource stream
        /// </summary>
        /// <param name="virtualPath"></param>
        /// <returns></returns>
        public override VirtualFile GetFile(string virtualPath)
        {
            if (EmbeddedViewPath.IsEmbeddedView(virtualPath))
            {
                //to get the file we need to get
                var hash = EmbeddedViewPath.GetHashFromPath(virtualPath);
                if (!string.IsNullOrEmpty(hash))
                {
                    return(new EmbeddedViewVirtualFile(EmbeddedViewPath.GetViewResourceType(hash), virtualPath));
                }
            }

            //let the base class handle this
            return(Previous.GetFile(virtualPath));
        }
Exemplo n.º 3
0
 public override bool FileExists(string virtualPath)
 {
     return(EmbeddedViewPath.IsEmbeddedView(virtualPath) || (Previous != null && Previous.FileExists(virtualPath)));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Returns the embedded view path for the model specified or an empty string if the embedded view attribute was not found
 /// </summary>
 /// <param name="a"></param>
 /// <returns></returns>
 public static string GetEmbeddedViewPath(EmbeddedViewAttribute a)
 {
     return(a == null ? string.Empty : EmbeddedViewPath.Create(string.Concat(a.CompiledViewName, ",", a.AssemblyName)));
 }
 /// <summary>
 /// Return the string representation of the file
 /// </summary>
 /// <returns></returns>
 public string GetContents()
 {
     return(EmbeddedViewPath.GetViewContent(_resourcePath));
 }
 /// <summary>
 /// Opens the resource as as Stream
 /// </summary>
 /// <returns></returns>
 public override Stream Open()
 {
     return(EmbeddedViewPath.Open(_resourcePath));
 }
 public static string GetEmbeddedViewPath(this HtmlHelper html, string viewPath, string assembly)
 {
     return(EmbeddedViewPath.Create(viewPath, assembly));
 }