Ejemplo n.º 1
0
        public VirtualCollection(IVirtualCollectionSource <T> source, int pageSize, int cachedPages,
                                 IEqualityComparer <T> equalityComparer)
        {
            if (pageSize < 1)
            {
                throw new ArgumentException("pageSize must be bigger than 0");
            }

            if (equalityComparer == null)
            {
                throw new ArgumentNullException("equalityComparer");
            }

            _source = source;
            _source.CollectionChanged += HandleSourceCollectionChanged;
            _source.CountChanged      += HandleCountChanged;
            _pageSize         = pageSize;
            _equalityComparer = equalityComparer;
            _virtualItems     = CreateItemsCache(pageSize);
            _currentItem      = -1;
            _synchronizationContextScheduler         = TaskScheduler.FromCurrentSynchronizationContext();
            _mostRecentlyRequestedPages              = new MostRecentUsedList <int>(cachedPages);
            _mostRecentlyRequestedPages.ItemEvicted += HandlePageEvicted;

            (_sortDescriptions as INotifyCollectionChanged).CollectionChanged += HandleSortDescriptionsChanged;
        }
 public Exporter(Stream stream, IVirtualCollectionSource <ViewableDocument> collectionSource,
                 IList <ColumnDefinition> columns)
 {
     this.stream           = stream;
     this.collectionSource = collectionSource;
     this.columns          = columns;
 }
Ejemplo n.º 3
0
 public VirtualCollection(IVirtualCollectionSource <T> source, int pageSize, int cachedPages)
     : this(source, pageSize, cachedPages, EqualityComparer <T> .Default)
 {
 }
 public VirtualCollection(IVirtualCollectionSource source, int pageSize, int cachedPages,
                          IEqualityComparer <object> equalityComparer)
     : this(source, pageSize, cachedPages, equalityComparer, null)
 {
 }
 public VirtualCollection(IVirtualCollectionSource source, int pageSize, int cachedPages, TaskScheduler taskScheduler)
     : this(source, pageSize, cachedPages, EqualityComparer <object> .Default, taskScheduler)
 {
 }
 public Exporter(Stream stream, IVirtualCollectionSource<ViewableDocument> collectionSource,
                 IList<ColumnDefinition> columns)
 {
     this.stream = stream;
     this.collectionSource = collectionSource;
     this.columns = columns;
 }