Ejemplo n.º 1
0
        public List <HawkFileArchiveItem> Scan()
        {
            var ret = new List <HawkFileArchiveItem>();

            int idx = 0;

            foreach (var i in _archive.Entries)
            {
                if (i.IsDirectory)
                {
                    continue;
                }

                var ai = new HawkFileArchiveItem
                {
                    Name         = HawkFile.Util_FixArchiveFilename(i.Key),
                    Size         = (long)i.Size,
                    ArchiveIndex = idx++,
                    Index        = ret.Count
                };

                ret.Add(ai);
            }

            return(ret);
        }
 public List <HawkFileArchiveItem> Scan() =>
 _archive.Entries.Where(e => !e.IsDirectory)
 .Select((e, i) => new HawkFileArchiveItem
 {
     Name         = HawkFile.Util_FixArchiveFilename(e.Key),
     Size         = e.Size,
     Index        = i,
     ArchiveIndex = i
 })
 .ToList();
        public List <HawkFileArchiveItem> Scan()
        {
            var ret = new List <HawkFileArchiveItem>();

            for (int i = 0; i < _extractor.ArchiveFileData.Count; i++)
            {
                var afd = _extractor.ArchiveFileData[i];
                if (afd.IsDirectory)
                {
                    continue;
                }

                var ai = new HawkFileArchiveItem
                {
                    Name = HawkFile.Util_FixArchiveFilename(afd.FileName),
                    Size = (long)afd.Size, ArchiveIndex = i, Index = ret.Count
                };

                ret.Add(ai);
            }

            return(ret);
        }