Ejemplo n.º 1
0
        public override void Open(string filename)
        {
            _realDirectory = filename;
            _context = new RealContext(new DirectoryInfo(filename));

            BuildFS();
        }
Ejemplo n.º 2
0
        public FileEntry(RealContext context, FileInfo file)
        {
            Context = context;
            _file   = file;

            string ext = file.Extension;

            if (_resourceFiles.Contains(ext))
            {
                FileStream fs = _file.OpenRead();
                try
                {
                    IsResourceFile = ResourceUtil.IsResource(fs);

                    if (IsResourceFile)
                    {
                        fs.Position = 0;
                        ResourceType resType;
                        uint         flags;
                        ResourceUtil.GetResourceData(fs, out flags, out resType);
                        ResourceType = resType;
                    }
                }
                catch
                {
                    ResourceType   = 0;
                    IsResourceFile = false;
                }
                finally
                {
                    fs.Close();
                }
            }
        }
Ejemplo n.º 3
0
        public DirectoryEntry(RealContext context, DirectoryInfo directory)
        {
            Context    = context;
            _directory = directory;

            _subdirs = directory.GetDirectories();
            _files   = directory.GetFiles();
        }
Ejemplo n.º 4
0
        public DirectoryEntry(RealContext context, DirectoryInfo directory)
        {
            Context = context;
            _directory = directory;

            _subdirs = directory.GetDirectories();
            _files = directory.GetFiles();
        }
Ejemplo n.º 5
0
        public FileEntry(RealContext context, FileInfo file)
        {
            Context = context;
            _file = file;

            string ext = file.Extension;

            if (_resourceFiles.Contains(ext))
            {

                FileStream fs = _file.OpenRead();
                try
                {
                    IsResourceFile = ResourceUtil.IsResource(fs);

                    if (IsResourceFile)
                    {
                        fs.Position = 0;
                        ResourceType resType;
                        uint flags;
                        ResourceUtil.GetResourceData(fs, out flags, out resType);
                        ResourceType = resType;
                    }
                }
                catch
                {
                    ResourceType = 0;
                    IsResourceFile = false;
                }
                finally
                {
                    fs.Close();
                }

            }
        }