public ActiveCreative GetLinearCreative(VASTADInLine inline, VASTADInLineCreative Creative, VASTADInLineCreativeLinear linear, IAdSource AdSource)
 {
     //get the target. In this case because it is a linear ad, it will aways be the player's main adcontainer
     IAdTarget target = VastAdHandler.FindTarget(AdSource, new LinearSource(inline, null, linear, new VASTADWrapper[] { }));
     if (target == null)
     {
         return null;
     }
     else
     {
         return GetLinearCreative(linear, target, inline);
     }
 }
        public ActiveCreative GetLinearCreative(VASTADInLine inline, VASTADInLineCreative Creative, VASTADInLineCreativeLinear linear, IAdSource AdSource)
        {
            //get the target. In this case because it is a linear ad, it will aways be the player's main adcontainer
            IAdTarget target = VastAdHandler.FindTarget(AdSource, new LinearSource(inline, null, linear, new VASTADWrapper[] { }));

            if (target == null)
            {
                return(null);
            }
            else
            {
                return(GetLinearCreative(linear, target, inline));
            }
        }
        private static VASTADWrapperCreative FindMatchingCreative(VASTADInLine ad, VASTADInLineCreative creative, VASTADWrapper wrapperAd)
        {
            Type type = creative.Item.GetType();
            var  appropriateCreatives = ad.Creatives.Where(c => c.Item.GetType() == type);
            Type matchingType;

            if (type == typeof(VASTADInLineCreativeLinear))
            {
                matchingType = typeof(VASTADWrapperCreativeLinear);
            }
            else if (type == typeof(VASTADInLineCreativeNonLinearAds))
            {
                matchingType = typeof(VASTADWrapperCreativeNonLinearAds);
            }
            else if (type == typeof(VASTADInLineCreativeCompanionAds))
            {
                matchingType = typeof(VASTADWrapperCreativeCompanionAds);
            }
            else
            {
                return(null);
            }

            var appropriateWrapperCreatives = wrapperAd.Creatives.Where(c => c.Item.GetType() == matchingType);

            int index = appropriateCreatives.ToList().IndexOf(creative);

            if (appropriateWrapperCreatives.Count() > index)
            {
                return(appropriateWrapperCreatives.ElementAt(index));
            }
            else
            {
                return(null);
            }
        }
Example #4
0
 internal VastCreative(VASTADInLineCreative Creative, VastCreativeSet Parent)
 {
     this.Parent   = Parent;
     this.Creative = Creative;
 }
Example #5
0
 internal NonLinearVastCreative(NonLinear_type NonLinear, VASTADInLineCreative Creative, VastCreativeSet Parent)
     : base(Creative, Parent)
 {
     this.NonLinear = NonLinear;
 }
Example #6
0
 internal LinearVastCreative(VASTADInLineCreativeLinear Linear, VASTADInLineCreative Creative, VastCreativeSet Parent)
     : base(Creative, Parent)
 {
     this.Linear = Linear;
 }
Example #7
0
 internal CompanionVastCreative(Companion_type Companion, VASTADInLineCreative Creative, VastCreativeSet Parent)
     : base(Creative, Parent)
 {
     this.Companion = Companion;
 }
 internal VastCreative(VASTADInLineCreative Creative, VastCreativeSet Parent)
 {
     this.Parent = Parent;
     this.Creative = Creative;
 }
 internal NonLinearVastCreative(NonLinear_type NonLinear, VASTADInLineCreative Creative, VastCreativeSet Parent)
     : base(Creative, Parent)
 {
     this.NonLinear = NonLinear;
 }
 internal LinearVastCreative(VASTADInLineCreativeLinear Linear, VASTADInLineCreative Creative, VastCreativeSet Parent)
     : base(Creative, Parent)
 {
     this.Linear = Linear;
 }
 internal CompanionVastCreative(Companion_type Companion, VASTADInLineCreative Creative, VastCreativeSet Parent)
     : base(Creative, Parent)
 {
     this.Companion = Companion;
 }
        private static VASTADWrapperCreative FindMatchingCreative(VASTADInLine ad, VASTADInLineCreative creative, VASTADWrapper wrapperAd)
        {
            Type type = creative.Item.GetType();
            var appropriateCreatives = ad.Creatives.Where(c => c.Item.GetType() == type);
            Type matchingType;
            if (type == typeof(VASTADInLineCreativeLinear))
                matchingType = typeof(VASTADWrapperCreativeLinear);
            else if (type == typeof(VASTADInLineCreativeNonLinearAds))
                matchingType = typeof(VASTADWrapperCreativeNonLinearAds);
            else if (type == typeof(VASTADInLineCreativeCompanionAds))
                matchingType = typeof(VASTADWrapperCreativeCompanionAds);
            else
                return null;

            var appropriateWrapperCreatives = wrapperAd.Creatives.Where(c => c.Item.GetType() == matchingType);

            int index = appropriateCreatives.ToList().IndexOf(creative);
            if (appropriateWrapperCreatives.Count() > index)
                return appropriateWrapperCreatives.ElementAt(index);
            else
                return null;
        }