コード例 #1
0
 /// <summary>
 /// Sorts all items in list according to user selection.
 /// </summary>
 private void SortList()
 {
     ArchiveFileSorter.SetSorter((ArchiveFileSortOrder)cmbSortOrder.SelectedIndex, cbDesc.Checked);
     lvFiles.BeginUpdate();
     _files.Sort(_filesSorter);
     lvFiles.EndUpdate();
 }
コード例 #2
0
        public BSABrowser()
        {
            InitializeComponent();

            // Show application version in title
            this.Text += $" ({Program.GetVersion()})";

            // Store title so it can be restored later,
            // for example when showing the extraction progress in title
            _untouchedTitle = this.Text;

            lvFiles.ContextMenu = contextMenu1;

            if (Settings.Default.UpdateSettings)
            {
                Settings.Default.Upgrade();
                Settings.Default.UpdateSettings = false;
                Settings.Default.Save();
            }

            // Restore last path for OpenFolderDialog
            if (!string.IsNullOrEmpty(Settings.Default.LastUnpackPath))
            {
                _openFolderDialog.InitialFolder = Settings.Default.LastUnpackPath;
            }

            // Load Recent Files list
            if (Settings.Default.RecentFiles != null)
            {
                foreach (string item in Settings.Default.RecentFiles)
                {
                    this.AddToRecentFiles(item);
                }
            }

            // Load Quick Extract Paths
            if (Settings.Default.QuickExtractPaths == null)
            {
                Settings.Default.QuickExtractPaths = new QuickExtractPaths();
            }

            this.LoadQuickExtractPaths();

            // Set lvFiles sorter
            ArchiveFileSorter.SetSorter(Settings.Default.SortType, Settings.Default.SortDesc);

            // Enable visual styles
            tvFolders.EnableVisualStyles();
            tvFolders.EnableAutoScroll();

            lvFiles.EnableVisualStyles();
            lvFiles.EnableVisualStylesSelection();
            lvFiles.HideFocusRectangle();

            // Set TextBox cue
            txtSearch.SetCue("Search term...");
        }