private static bool ProcessRequestForNonMapPathBasedVirtualFile(HttpRequest request, HttpResponse response, string overrideVirtualPath)
        {
            bool flag = false;

            if (HostingEnvironment.UsingMapPathBasedVirtualPathProvider)
            {
                return(flag);
            }
            VirtualFile vf          = null;
            string      virtualPath = (overrideVirtualPath == null) ? request.FilePath : overrideVirtualPath;

            if (HostingEnvironment.VirtualPathProvider.FileExists(virtualPath))
            {
                vf = HostingEnvironment.VirtualPathProvider.GetFile(virtualPath);
            }
            if (vf == null)
            {
                throw new HttpException(0x194, System.Web.SR.GetString("File_does_not_exist"));
            }
            if (vf is MapPathBasedVirtualFile)
            {
                return(flag);
            }
            response.WriteVirtualFile(vf);
            response.ContentType = MimeMapping.GetMimeMapping(virtualPath);
            return(true);
        }
        private static bool ProcessRequestForNonMapPathBasedVirtualFile(HttpRequest request, HttpResponse response, string overrideVirtualPath)
        {
            bool handled = false;

            // only process custom virtual path providers here
            if (HostingEnvironment.UsingMapPathBasedVirtualPathProvider)
            {
                return(handled);
            }

            VirtualFile virtualFile = null;
            String      virtualPath = (overrideVirtualPath == null) ? request.FilePath : overrideVirtualPath;

            if (HostingEnvironment.VirtualPathProvider.FileExists(virtualPath))
            {
                virtualFile = HostingEnvironment.VirtualPathProvider.GetFile(virtualPath);
            }

            if (virtualFile == null)
            {
                Debug.Trace("StaticFileHandler", "Virtual file " + virtualPath + " not found");
                throw new HttpException(HttpStatus.NotFound,
                                        SR.GetString(SR.File_does_not_exist));
            }

            // if we have a MapPathBasedVirtualFile, we can handle it the normal way
            if (virtualFile is MapPathBasedVirtualFile)
            {
                return(handled);
            }

            Debug.Trace("StaticFileHandler", "Using VirtualPathProvider for " + virtualPath);

            response.WriteVirtualFile(virtualFile);
            response.ContentType = MimeMapping.GetMimeMapping(virtualPath);
            handled = true;
            return(handled);
        }
        private static bool ProcessRequestForNonMapPathBasedVirtualFile(HttpRequest request, HttpResponse response, string overrideVirtualPath) {
            bool handled = false;

            // only process custom virtual path providers here
            if (HostingEnvironment.UsingMapPathBasedVirtualPathProvider) {
                return handled;
            }

            VirtualFile virtualFile = null;
            String virtualPath = (overrideVirtualPath == null) ? request.FilePath : overrideVirtualPath;

            if (HostingEnvironment.VirtualPathProvider.FileExists(virtualPath)) {
                virtualFile = HostingEnvironment.VirtualPathProvider.GetFile(virtualPath);
            }
            
            if (virtualFile == null) {
                Debug.Trace("StaticFileHandler", "Virtual file " + virtualPath + " not found");
                throw new HttpException( HttpStatus.NotFound, 
                                         SR.GetString(SR.File_does_not_exist) );
            }

            // if we have a MapPathBasedVirtualFile, we can handle it the normal way
            if (virtualFile is MapPathBasedVirtualFile) {
                return handled;
            }

            Debug.Trace("StaticFileHandler", "Using VirtualPathProvider for " + virtualPath);

            response.WriteVirtualFile(virtualFile);
            response.ContentType = MimeMapping.GetMimeMapping(virtualPath);
            handled = true;
            return handled;
        }
 private static bool ProcessRequestForNonMapPathBasedVirtualFile(HttpRequest request, HttpResponse response, string overrideVirtualPath)
 {
     bool flag = false;
     if (HostingEnvironment.UsingMapPathBasedVirtualPathProvider)
     {
         return flag;
     }
     VirtualFile vf = null;
     string virtualPath = (overrideVirtualPath == null) ? request.FilePath : overrideVirtualPath;
     if (HostingEnvironment.VirtualPathProvider.FileExists(virtualPath))
     {
         vf = HostingEnvironment.VirtualPathProvider.GetFile(virtualPath);
     }
     if (vf == null)
     {
         throw new HttpException(0x194, System.Web.SR.GetString("File_does_not_exist"));
     }
     if (vf is MapPathBasedVirtualFile)
     {
         return flag;
     }
     response.WriteVirtualFile(vf);
     response.ContentType = MimeMapping.GetMimeMapping(virtualPath);
     return true;
 }