private void DoAdd(FileSystemModelEntry entry) { Insert(entry); if (_lastVisibleNode != null && entry.Size >= _lastVisibleNode.Value.Size) { entry.Visible = true; _visibleEntriesCount++; } }
internal void Add(FileSystemModelEntry entry) { if (entry == null) { throw new ArgumentNullException(nameof(entry)); } UpdateSize(entry.Size); DoAdd(entry); entry.NotifyVisibilityChanged(); }
internal void UpdateEntryPosition(FileSystemModelEntry entry) { if (entry == null) { throw new ArgumentNullException(nameof(entry)); } var node = _entries.Find(entry); node = Swim(node); Sink(node); }
internal void Delete(FileSystemModelEntry entry) { if (entry == null) { throw new ArgumentNullException(nameof(entry)); } var node = _entries.Find(entry); DoDelete(node); UpdateSize(-entry.Size); entry.NotifyVisibilityChanged(); }
private LinkedListNode <FileSystemModelEntry> Insert(FileSystemModelEntry entry) { var current = _entries.First; if (current == null) { return(_entries.AddFirst(entry)); } while (current != null && current.Value.Size > entry.Size) { current = current.Next; } return(current != null ? _entries.AddBefore(current, entry) : _entries.AddLast(entry)); }
private bool IsShouldBeVisible(FileSystemModelEntry entry) { return(entry.Size != 0 && Size * Model.EntrySizeThreshold <= entry.Size); }