Ejemplo n.º 1
0
        private void PostPixelEvent(string eventName)
        {
            AdPixelEvent adPixelEvent = new AdPixelEvent();
            bool         flag         = false;

            if (this.NewsItem.ads_statistics != null)
            {
                foreach (AdStatistics adsStatistic in this.NewsItem.ads_statistics)
                {
                    if (adsStatistic.type == eventName)
                    {
                        flag = true;
                        adPixelEvent.UrlToLoad.Add(adsStatistic.url);
                    }
                }
            }
            foreach (Ad ad in this.NewsItem.ads)
            {
                if (ad.statistics != null)
                {
                    foreach (AdStatistics statistic in ad.statistics)
                    {
                        if (statistic.type == eventName)
                        {
                            flag = true;
                            adPixelEvent.UrlToLoad.Add(statistic.url);
                        }
                    }
                }
            }
            if (!flag)
            {
                return;
            }
            EventAggregator.Current.Publish((object)adPixelEvent);
        }
Ejemplo n.º 2
0
 public void Handle(AdPixelEvent message)
 {
     this.LoadUris(message.UrlToLoad);
 }