Пример #1
0
        private static ICreative FindMatchingCreative(Ad ad, ICreative creative, Ad wrapperAd)
        {
            Type type = creative.GetType();

            var appropriateCreatives        = ad.Creatives.Where(c => c.GetType() == type).ToList();
            var appropriateWrapperCreatives = wrapperAd.Creatives.Where(c => c.GetType() == type).ToList();

            int index = appropriateCreatives.IndexOf(creative);

            if (appropriateWrapperCreatives.Count > index)
            {
                return(appropriateWrapperCreatives.ElementAt(index));
            }
            else
            {
                return(null);
            }
        }
 internal static ICreative FindMatchingCreative(ICreative creative, Ad searchAd)
 {
     var type = creative.GetType();
     return searchAd.Creatives.Where(c => c.GetType() == type).FirstOrDefault();
 }
        private static ICreative FindMatchingCreative(Ad ad, ICreative creative, Ad wrapperAd)
        {
            Type type = creative.GetType();

            var appropriateCreatives = ad.Creatives.Where(c => c.GetType() == type).ToList();
            var appropriateWrapperCreatives = wrapperAd.Creatives.Where(c => c.GetType() == type).ToList();

            int index = appropriateCreatives.IndexOf(creative);

            if (appropriateWrapperCreatives.Count > index)
                return appropriateWrapperCreatives.ElementAt(index);
            else
                return null;
        }
Пример #4
0
        internal static ICreative FindMatchingCreative(ICreative creative, Ad searchAd)
        {
            var type = creative.GetType();

            return(searchAd.Creatives.Where(c => c.GetType() == type).FirstOrDefault());
        }