Exemplo n.º 1
0
 /// <summary>
 /// Método usado para converter o loader.
 /// </summary>
 /// <param name="loader"></param>
 /// <returns></returns>
 private static VirtualListLoader <DataWrapper <T> > ConverterLoader(VirtualListLoader <T> loader)
 {
     return(VirtualListLoader <DataWrapper <T> > .Create((sender, e) => {
         var result = loader.Load((IObservableCollection)sender, e.StartRow, e.PageSize, e.NeedItemsCount, e.ReferenceObject);
         if (result.Error != null)
         {
             return new VirtualListLoaderResult <DataWrapper <T> >(result.Error);
         }
         IEnumerable <DataWrapper <T> > items = result.Items != null ? result.Items.Select(f => new DataWrapper <T>(0, f)) : null;
         if (result.UpdateCount)
         {
             return new VirtualListLoaderResult <DataWrapper <T> >(items, result.NewCount);
         }
         return new VirtualListLoaderResult <DataWrapper <T> >(items);
     }));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Método usado para converter o loader.
 /// </summary>
 /// <param name="loader"></param>
 /// <returns></returns>
 private static VirtualListLoader <DataWrapper <T> > ConverterLoader(VirtualListLoaderHandler <T> loader)
 {
     return(VirtualListLoader <DataWrapper <T> > .Create((sender, e) => {
         var result = loader(sender, e);
         if (result.Error != null)
         {
             return new VirtualListLoaderResult <DataWrapper <T> >(result.Error);
         }
         IEnumerable <DataWrapper <T> > items = result.Items != null ? result.Items.Select(f => new DataWrapper <T>(0, f)) : null;
         if (result.UpdateCount)
         {
             return new VirtualListLoaderResult <DataWrapper <T> >(items, result.NewCount);
         }
         return new VirtualListLoaderResult <DataWrapper <T> >(items);
     }));
 }
Exemplo n.º 3
0
 public VirtualList(int pageSize, VirtualListLoaderHandler <T> loader, object referenceObject) : this(pageSize, VirtualListLoader <T> .Create(loader), referenceObject)
 {
 }