Ejemplo n.º 1
0
        private VirtualPath SimpleCombine(string filename, bool addTrailingSlash)
        {
            // The left part should always be a directory
            Debug.Assert(HasTrailingSlash);

            // The right part should not start or end with a slash
            Debug.Assert(filename[0] != '/' && !UrlPath.HasTrailingSlash(filename));

            // Use either _appRelativeVirtualPath or _virtualPath
            string virtualPath = VirtualPathStringWhicheverAvailable + filename;

            if (addTrailingSlash)
            {
                virtualPath += "/";
            }

            // Set the appropriate virtual path in the new object
            VirtualPath combinedVirtualPath = new VirtualPath(virtualPath);

            // Copy some flags over to avoid having to recalculate them
            combinedVirtualPath.CopyFlagsFrom(this, isWithinAppRootComputed | isWithinAppRoot | appRelativeAttempted);
#if DBG
            combinedVirtualPath.ValidateState();
#endif
            return(combinedVirtualPath);
        }
        private VirtualPath SimpleCombine(string filename, bool addTrailingSlash)
        {
            string virtualPath = this.VirtualPathStringWhicheverAvailable + filename;

            if (addTrailingSlash)
            {
                virtualPath = virtualPath + "/";
            }
            VirtualPath path = new VirtualPath(virtualPath);

            path.CopyFlagsFrom(this, 7);
            return(path);
        }
Ejemplo n.º 3
0
        private VirtualPath SimpleCombine(string filename, bool addTrailingSlash) {

            // The left part should always be a directory
            Debug.Assert(HasTrailingSlash);

            // The right part should not start or end with a slash
            Debug.Assert(filename[0] != '/' && !UrlPath.HasTrailingSlash(filename));

            // Use either _appRelativeVirtualPath or _virtualPath
            string virtualPath = VirtualPathStringWhicheverAvailable + filename;
            if (addTrailingSlash)
                virtualPath += "/";

            // Set the appropriate virtual path in the new object
            VirtualPath combinedVirtualPath = new VirtualPath(virtualPath);

            // Copy some flags over to avoid having to recalculate them
            combinedVirtualPath.CopyFlagsFrom(this, isWithinAppRootComputed | isWithinAppRoot | appRelativeAttempted);
#if DBG
            combinedVirtualPath.ValidateState();
#endif
            return combinedVirtualPath;
        }