Exemplo n.º 1
0
        private void LoadArchive()
        {
            if (_archive != null)
            {
                _archive.Dispose();
                _archive = null;
            }

            Text = "Archive - []";
            listView.Items.Clear();

            if (_info == null)
                return;

            Text = $"Archive - [{_info.FullName}]";

            _archive = PffArchive.Open(_info);
            var entries = _archive.Entries;

            listView.BeginUpdate();
            foreach (var entry in entries)
            {
                var name = entry.FilePath;
                var lvi = new ListViewItem(name);
                lvi.SubItems.Add(entry.PackedTimeUtc.ToLocalTime().ToString(CultureInfo.CurrentCulture));
                lvi.SubItems.Add(name.IndexOfAny(Path.GetInvalidFileNameChars()) != -1
                    ? ""
                    : Path.GetExtension(entry.FilePath)?.Substring(1));
                lvi.SubItems.Add(entry.FileSize.ToString());

                listView.Items.Add(lvi);
            }
            listView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
            listView.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
            listView.EndUpdate();

            ClientSize = new Size(listView.PreferredWidth(), ClientSize.Height);
        }
Exemplo n.º 2
0
 public PffEntry(BinaryReader reader, PffArchive.IPffEntry entry)
 {
     _reader = reader;
     _entry = entry;
 }