コード例 #1
0
        /// <summary>
        /// Locate a JavaScript file at the given path. 
        /// </summary>
        /// <param name="subpath">The path that identifies the file</param>
        /// <param name="fileInfo">The discovered file if any</param>
        /// <returns>
        /// True if a JavaScript file was located at the given path
        /// </returns>
        public bool TryGetFileInfo(string subpath, out IFileInfo fileInfo)
		{
			IFileInfo internalFileInfo;
			fileInfo = null;

			if (!_physicalFileSystem.TryGetFileInfo(subpath, out internalFileInfo))
				return false;

			if (_extensions != null && !_extensions.Any(internalFileInfo.Name.EndsWith))
				return false;

			if (internalFileInfo.IsDirectory)
				return false;

			fileInfo = new BabelFileInfo(_transformer, internalFileInfo);
			return true;
		}
コード例 #2
0
        /// <summary>
        /// Locate a JavaScript file at the given path.
        /// </summary>
        /// <param name="subpath">The path that identifies the file</param>
        /// <param name="fileInfo">The discovered file if any</param>
        /// <returns>
        /// True if a JavaScript file was located at the given path
        /// </returns>
        public bool TryGetFileInfo(string subpath, out IFileInfo fileInfo)
        {
            IFileInfo internalFileInfo;

            fileInfo = null;

            if (!_physicalFileSystem.TryGetFileInfo(subpath, out internalFileInfo))
            {
                return(false);
            }

            if (_extensions != null && !_extensions.Any(internalFileInfo.Name.EndsWith))
            {
                return(false);
            }

            if (internalFileInfo.IsDirectory)
            {
                return(false);
            }

            fileInfo = new BabelFileInfo(_transformer, internalFileInfo);
            return(true);
        }