本文整理汇总了C#中BindableCollection.Match方法的典型用法代码示例。如果您正苦于以下问题:C# BindableCollection.Match方法的具体用法?C# BindableCollection.Match怎么用?C# BindableCollection.Match使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BindableCollection
的用法示例。
在下文中一共展示了BindableCollection.Match方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TrialsListModel
public TrialsListModel()
{
Trials = new BindableCollection<Trial>(new PrimaryKeyComparer<Trial>(x => x.Id));
Search = GetQueryParam("search");
RavenQueryStatistics stats;
var query = Session.Query<Trials_Search.ReduceResult>("Trials/Search")
.Statistics(out stats)
.Skip(Paging.PageNumber * ItemsPerPage)
.Take(ItemsPerPage);
if (string.IsNullOrEmpty(Search) == false)
{
query = query
.Where(x => x.Query == Search);
}
query
.OrderByDescending(x => x.StartedAt)
.As<Trial>()
.ToListAsync()
.ContinueOnSuccess(trials =>
{
Trials.Match(trials);
Paging.NumberOfItems.Value = stats.TotalResults;
Paging.NumberOfPages.Value = Paging.NumberOfItems.Value / ItemsPerPage;
});
}
示例2: HomeListModel
public HomeListModel()
{
string date = GetQueryParam("date");
if (date == null)
LookAtDate = DateTime.Today;
else
{
int year, month;
int.TryParse(date.Substring(6, 4), out year);
int.TryParse(date.Substring(3, 2), out month);
LookAtDate = new DateTime(year, month, 1);
}
ProductStats =
new BindableCollection<Products_Stats.ReduceResult>(
new PrimaryKeyComparer<Products_Stats.ReduceResult>(
x => Tuple.Create(x.Year, x.Month, x.Total.Currency, x.ProductId)));
Session.Query<Products_Stats.ReduceResult>("Products/Stats")
.Where(x => x.Year == LookAtDate.Year && x.Month == LookAtDate.Month)
.ToListAsync()
.ContinueOnSuccess(items => ProductStats.Match(items));
OrderStatsUsd = new BindableCollection<Orders_Stats.ReduceResult>(
new PrimaryKeyComparer<Orders_Stats.ReduceResult>(
x => Tuple.Create(x.Date, x.Currency)));
OrderStatsEuro =
new BindableCollection<Orders_Stats.ReduceResult>(
new PrimaryKeyComparer<Orders_Stats.ReduceResult>(
x => Tuple.Create(x.Date, x.Currency)));
DateTime yearBack = LookAtDate.AddYears(-1);
Session.Query<Orders_Stats.ReduceResult>("Orders/Stats")
.Where(x => x.Date >= yearBack && x.Date < LookAtDate && x.Currency == "EUR")
.ToListAsync()
.ContinueOnSuccess(items => OrderStatsEuro.Match(items));
Session.Query<Orders_Stats.ReduceResult>("Orders/Stats")
.Where(x => x.Date >= yearBack && x.Date < LookAtDate && x.Currency == "USD")
.ToListAsync()
.ContinueOnSuccess(items => OrderStatsUsd.Match(items));
}
示例3: ProductsListModel
public ProductsListModel()
{
Products = new BindableCollection<Product>(new PrimaryKeyComparer<Product>(x => x.Id));
Session.Query<Product>().ToListAsync()
.ContinueOnSuccess(products => Products.Match(products));
}