コード例 #1
0
        private void ParseFileIndex(FFileIndex Index)
        {
            _files.AddRange(Index.Directories.Select(dir =>
                                                     new SetFile()
            {
                Name        = dir.Key,
                Data        = new PakExplorer(this, dir.Value, dir.Key),
                IsDirectory = true,
            }));
            _files.AddRange(Index.Files.Select(entry =>
                                               new SetFile()
            {
                Name   = entry.Key,
                Data   = entry.Value,
                Length = entry.Value.Size,
            }));

            // Should never happen, but who knows...
            _files.ForEach(f =>
            {
                if (FarNet.Works.Kit.IsInvalidFileName(f.Name))
                {
                    f.Name = FarNet.Works.Kit.FixInvalidFileName(f.Name);
                }
            });
        }
コード例 #2
0
 PakExplorer(Explorer Parent, FFileIndex Index, string Loc) : this(Parent, Loc)
 {
     Task.Run(() => ParseFileIndex(Index));
 }