示例#1
0
 /// <summary>
 /// Constructor. Hooks up the event handler triggered when the timer ticks.
 /// </summary>
 /// <param name="itemsProvider">The items provider.</param>
 /// <param name="pageSize">Size of the page (number of items).</param>
 /// <param name="pageTimeout">The page timeout, in milliseconds.</param>
 /// <param name="loadCountInterval">The interval between count loads from the database, in milliseconds.</param>
 public VirtualizingCollectionDynamicAsync(IVirtualizingCollectionItemsProvider <T> itemsProvider, int pageSize, int pageTimeout, int loadCountInterval)
     : base(itemsProvider, pageSize, pageTimeout)
 {
     this.timer                  = new Timer(loadCountInterval);
     timer.AutoReset             = false;
     timer.Elapsed              += TimerCallback;
     itemsProvider.CountChanged += ItemsProvider_CountChanged;
     ItemsProvider_CountChanged(null, null);
 }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="VirtualizingCollectionAsync&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="itemsProvider">The items provider.</param>
 /// <param name="pageSize">Size of the page.</param>
 /// <param name="pageTimeout">The page timeout.</param>
 public VirtualizingCollectionAsync(IVirtualizingCollectionItemsProvider <T> itemsProvider, int pageSize, int pageTimeout)
     : base(itemsProvider, pageSize, pageTimeout)
 {
     _synchronizationContext = SynchronizationContext.Current;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="VirtualizingCollection&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="itemsProvider">The items provider.</param>
 /// <param name="pageSize">Size of the page.</param>
 public VirtualizingCollection(IVirtualizingCollectionItemsProvider <T> itemsProvider, int pageSize)
 {
     _itemsProvider = itemsProvider;
     _pageSize      = pageSize;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="VirtualizingCollection&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="itemsProvider">The items provider.</param>
 public VirtualizingCollection(IVirtualizingCollectionItemsProvider <T> itemsProvider)
 {
     _itemsProvider = itemsProvider;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="VirtualizingCollection&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="itemsProvider">The items provider.</param>
 /// <param name="pageSize">Size of the page.</param>
 /// <param name="pageTimeout">The page timeout.</param>
 public VirtualizingCollection(IVirtualizingCollectionItemsProvider <T> itemsProvider, int pageSize, int pageTimeout)
 {
     _itemsProvider = itemsProvider;
     _pageSize      = pageSize;
     _pageTimeout   = pageTimeout;
 }