private bool onStats(CatalogServiceEvents.UserStatsRetrievedEvent evt) { List <CatalogItemData> currentItems = evt.Response.currentItems; CatalogItemData mostPopularItem = evt.Response.mostPopularItem; long totalItemsPurchased = evt.Response.totalItemsPurchased; long totalItemsSold = evt.Response.totalItemsSold; CatalogStats catalogStats = new CatalogStats(mostPopularItem, currentItems, totalItemsPurchased, totalItemsSold); CatalogCacheData cacheDataById = cache.GetCacheDataById("catalogStatsCacheId"); cacheDataById.Data = catalogStats; cacheDataById.CacheTime = 0; cache.SetCatalogCacheData("catalogStatsCacheId", cacheDataById); Service.Get <EventDispatcher>().DispatchEvent(new CatalogServiceProxyEvents.StatsReponse(catalogStats)); return(false); }
public StatsReponse(CatalogStats stats) { Stats = stats; }