Ejemplo n.º 1
0
        /// <summary>
        /// Returns true if the file exists on either the disk or in the assembly
        /// </summary>
        /// <param name="filename"></param>
        /// <returns></returns>
        public bool FileExists(string filename)
        {
            bool isFile     = File.Exists(filename);
            bool isManifest = ManifestReader.Exists(filename);

            return(isFile || isManifest);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns the byte stream of the file specified
        /// </summary>
        /// <param name="filename"></param>
        /// <returns></returns>
        public Stream GetStream(string filename)
        {
            if (File.Exists(filename))
            {
                Logger.Log(LogType.Log, filename + " Found in File System.", 5);
                return(File.OpenRead(filename));
            }

            if (ManifestReader.Exists(filename))
            {
                Logger.Log(LogType.Log, filename + " Found in Assembly Manifest.", 5);
                return(ManifestReader.GetStreamByPath(filename));
            }

            throw new InvalidFilePathException(filename);
        }