protected void Run(ClientPipelineArgs args) { if (item != null && language != null) { using (var ctx = new ItemTrackingProvider()) { var siteInfo = SiteInfoExtensions.GetSites(this.item, item.Language).FirstOrDefault(); if (siteInfo != null) { BroadcastHtmlCacheRepository broadcastHtmlCacheRepository = new BroadcastHtmlCacheRepository(); var results = ctx.UspDeleteCacheDataForSite(siteInfo.Name, siteInfo.Language); foreach (var result in results) { broadcastHtmlCacheRepository.BroadcastMessage(new BroadcastHtmlCacheMessage { ToRemove = true, SiteName = result.SiteName, SiteLang = result.SiteLang }); } SheerResponse.Alert("All caches for all sites have been queued for clearing", true); } else { SheerResponse.Alert("Site could not be determined by the item in context", true); } } } else { SheerResponse.Alert("Site could not be determined by the item in context", true); } args.WaitForPostBack(false); }
protected void Run(ClientPipelineArgs args) { using (var ctx = new ItemTrackingProvider()) { var siteInfos = SiteInfoExtensions.GetSites(this.Item, null); if (siteInfos != null) { BroadcastHtmlCacheRepository broadcastHtmlCacheRepository = new BroadcastHtmlCacheRepository(); foreach (var siteInfo in siteInfos) { var results = ctx.UspDeleteCacheDataForSite(siteInfo.Name, siteInfo.Language); foreach (var result in results) { broadcastHtmlCacheRepository.BroadcastMessage(new BroadcastHtmlCacheMessage { ToRemove = true, SiteName = result.SiteName, SiteLang = result.SiteLang }); } } SheerResponse.Alert("Caches for the Site in all languages have been queue to be cleared", true); } else { SheerResponse.Alert("Site could not be determined by the item in context", true); } args.WaitForPostBack(false); } }