Esempio n. 1
0
        private void UpdateDisplay()
        {
            lstEntries.Items.Clear();

            UpdatePluginMenu();

            if (CurrentArchive == null)
            {
                lstEntries.Enabled = false;
                return;
            }
            else
            {
                lstEntries.Enabled = true;
            }

            lstEntries.BeginUpdate();
            lstEntries.ListViewItemSorter = null; // Disable sorting while adding

            for (int i = 0; i < CurrentArchive.Entries.Count; i++)
            {
                BundleEntry entry  = CurrentArchive.Entries[i];
                Color       color  = entry.GetColor();
                string[]    values = new string[]
                {
                    i.ToString("d3"),
                    entry.DetectName(),
                    "0x" + entry.ID.ToString("X8"),
                    entry.Type.ToString(),
                    entry.EntryBlocks[0].Data.Length.ToString(),
                    entry.EntryBlocks[0].Data.MakePreview(0, 16)
                };

                ListViewItem item = new ListViewItem(values);
                item.BackColor = color;
                lstEntries.Items.Add(item);
            }

            lstEntries.ListViewItemSorter = new EntrySorter(0); // Also calls Sort
            lstEntries.EndUpdate();
        }