Exemplo n.º 1
0
 internal VastCreativeSet(IEnumerable <VASTADInLineCreative> InlineCreatives, VastAd Parent)
     : base()
 {
     this.InlineCreatives = InlineCreatives;
     this.Parent          = Parent;
     this.FailureStrategy = Parent.FailureStrategy;
     foreach (var item in InlineCreatives)
     {
         object creativeItem = item.Item;
         if (creativeItem is VASTADInLineCreativeLinear)
         {
             var linear = creativeItem as VASTADInLineCreativeLinear;
             base.Creatives.Add(new LinearVastCreative(linear, item, this));
         }
         else if (creativeItem is VASTADInLineCreativeNonLinearAds)
         {
             var nonLinears = creativeItem as VASTADInLineCreativeNonLinearAds;
             if (nonLinears.NonLinear != null)
             {
                 foreach (NonLinear_type nl in nonLinears.NonLinear)
                 {
                     base.Creatives.Add(new NonLinearVastCreative(nl, item, this));
                 }
             }
         }
         else if (creativeItem is VASTADInLineCreativeCompanionAds)
         {
             var companions = creativeItem as VASTADInLineCreativeCompanionAds;
             if (companions.Companion != null)
             {
                 foreach (Companion_type comp in companions.Companion)
                 {
                     base.Creatives.Add(new CompanionVastCreative(comp, item, this));
                 }
             }
         }
     }
 }
 internal VastCreativeSet(IEnumerable<VASTADInLineCreative> InlineCreatives, VastAd Parent)
     : base()
 {
     this.InlineCreatives = InlineCreatives;
     this.Parent = Parent;
     this.FailureStrategy = Parent.FailureStrategy;
     foreach (var item in InlineCreatives)
     {
         object creativeItem = item.Item;
         if (creativeItem is VASTADInLineCreativeLinear)
         {
             var linear = creativeItem as VASTADInLineCreativeLinear;
             base.Creatives.Add(new LinearVastCreative(linear, item, this));
         }
         else if (creativeItem is VASTADInLineCreativeNonLinearAds)
         {
             var nonLinears = creativeItem as VASTADInLineCreativeNonLinearAds;
             if (nonLinears.NonLinear != null)
             {
                 foreach (NonLinear_type nl in nonLinears.NonLinear)
                 {
                     base.Creatives.Add(new NonLinearVastCreative(nl, item, this));
                 }
             }
         }
         else if (creativeItem is VASTADInLineCreativeCompanionAds)
         {
             var companions = creativeItem as VASTADInLineCreativeCompanionAds;
             if (companions.Companion != null)
             {
                 foreach (Companion_type comp in companions.Companion)
                 {
                     base.Creatives.Add(new CompanionVastCreative(comp, item, this));
                 }
             }
         }
     }
 }