Example #1
0
        public IEnumerable <IGameDataEntry> GetEntries()
        {
            var dirs  = m_directory.GetDirectories().Select(a => new ArchiveDirectoryEntry(a));
            var files = m_directory.GetFiles().Select(a => GetEntry(a.Name));

            return(dirs.Cast <IGameDataEntry>().Concat(files));
        }
        public DirectoryViewModel(IArchiveDirectory directory, DirectoryViewModel parent)
        {
            this.directory       = directory;
            this.parentDirectory = parent;

            childDirectories = new List <DirectoryViewModel>();
            foreach (var f in directory.GetDirectories())
            {
                var dd = new DirectoryViewModel(f, this);
                childDirectories.Add(dd);
            }
        }
 private void RebuildDictionary(IArchiveDirectory sourceDirectory, IArchiveDirectory destinationDirectory, RageArchiveEncryption7 archiveEncryption)
 {
     foreach (var sourceFile in sourceDirectory.GetFiles())
     {
         RebuildFile(sourceFile, destinationDirectory, archiveEncryption);
     }
     foreach (var sourceSubDirectory in sourceDirectory.GetDirectories())
     {
         var destinationSubDirectory = destinationDirectory.CreateDirectory();
         destinationSubDirectory.Name = sourceSubDirectory.Name;
         RebuildDictionary(sourceSubDirectory, destinationSubDirectory, archiveEncryption);
     }
 }
 private static void ForEachFile(string fullPathName, IArchiveDirectory directory, RageArchiveEncryption7 encryption, ProcessFileDelegate processDelegate)
 {
     foreach (var file in directory.GetFiles())
     {
         processDelegate(fullPathName + "\\" + file.Name, file, encryption);
         if ((file is IArchiveBinaryFile) && file.Name.EndsWith(".rpf", StringComparison.OrdinalIgnoreCase))
         {
             var fileStream   = ((IArchiveBinaryFile)file).GetStream();
             var inputArchive = RageArchiveWrapper7.Open(fileStream, file.Name);
             ForEachFile(fullPathName + "\\" + file.Name, inputArchive.Root, inputArchive.archive_.Encryption, processDelegate);
         }
     }
     foreach (var subDirectory in directory.GetDirectories())
     {
         ForEachFile(fullPathName + "\\" + subDirectory.Name, subDirectory, encryption, processDelegate);
     }
 }
Example #5
0
        public DirectoryViewModel(IArchiveDirectory directory, DirectoryViewModel parent)
        {
            this.directory = directory;
            this.parentDirectory = parent;

            childDirectories = new List<DirectoryViewModel>();
            foreach (var f in directory.GetDirectories())
            {
                var dd = new DirectoryViewModel(f, this);
                childDirectories.Add(dd);
            }
        }