示例#1
0
        /// <summary>
        /// Initializes FilesPanePresenter using the comparison provided in <paramref name="sortOrder"/>.
        /// </summary>
        /// <param name="paneView">Underlying files pane.</param>
        /// <param name="currentDir">Current position in file system tree.</param>
        /// <param name="sortOrder">Sort order according to which should be the entries sorted.</param>
        public FilesPanePresenter(IFilesPane paneView, DirectoryInfo currentDir, Comparison <FileSystemNodeEntry> sortOrder)
        {
            pane = paneView;

            entriesHolder = new SortedEntriesHolder <FileSystemNodeEntry>((EntriesPane <FileSystemNodeEntry>)pane, AlterSortOrder(sortOrder))
            {
                HighlightingFilter = entry => entry.GetType() != typeof(ParentDirectoryEntry) && entry.GetType() != typeof(ErrorEntry)
            };

            entriesHolder.NewEntryHighlighted   += NewEntryHighlighted;
            entriesHolder.OldEntryUnhighlighted += OldEntryUnhighlighted;

            ChangeDirectory(currentDir);
        }
示例#2
0
 /// <summary>
 /// Initializes FilesPanePresenter using default comparison of entries.
 /// </summary>
 /// <param name="paneView">Underlying files pane.</param>
 /// <param name="currentDir">Current position in the file system tree.</param>
 public FilesPanePresenter(IFilesPane paneView, DirectoryInfo currentDir)
     : this(paneView, currentDir, (x, y) => string.Compare(x.EntryName, y.EntryName, StringComparison.OrdinalIgnoreCase))
 {
 }