Esempio n. 1
0
        public static VMAP GetVMAP(ImpulseApp.Models.AdModels.SimpleAdModel adGBO)
        {

            VMAP vmap = new VMAP();
            VMAPAdBreak vmapAd = new VMAPAdBreak();
            VMAPAdBreakAdSource adSource = new VMAPAdBreakAdSource();
            //vmapAd.TrackingEvents = null;
            List<VMAPAdBreakAdSourceVASTAdData> ads = new List<VMAPAdBreakAdSourceVASTAdData>();
            foreach (var state in adGBO.AdStates)
            {
                VMAPAdBreakAdSourceVASTAdData vast = new VMAPAdBreakAdSourceVASTAdData();
                vast.VAST = GetVastFromAdState(state);
                ads.Add(vast);
            }
            adSource.VASTAdData = ads.ToArray();
            adSource.allowMultipleAds = true;
            adSource.followRedirects = true;
            vmapAd.AdSource = new VMAPAdBreakAdSource[1];
            vmapAd.AdSource[0] = adSource;
            vmap.AdBreak = new VMAPAdBreak[1];
            vmap.AdBreak[0] = vmapAd;
            return vmap;
        }
Esempio n. 2
0
        VMAP IOutboundService.GetVMAP(int id)
        {
            ImpulseApp.Models.AdModels.SimpleAdModel adGBO = db.GetAdById(id);


            VMAP vmap = new VMAP();
            VMAPAdBreak vmapAd = new VMAPAdBreak();
            VMAPAdBreakAdSource adSource = new VMAPAdBreakAdSource();
            List<VMAPAdBreakAdSourceVASTAdData> ads = new List<VMAPAdBreakAdSourceVASTAdData>();
            foreach (var state in adGBO.AdStates)
            {
                VMAPAdBreakAdSourceVASTAdData vast = new VMAPAdBreakAdSourceVASTAdData();
                vast.VAST = GetVastFromAdState(state);
                ads.Add(vast);
            }
            adSource.VASTAdData = ads.ToArray();
            adSource.allowMultipleAds = true;
            adSource.followRedirects = true;
            vmapAd.AdSource = new VMAPAdBreakAdSource[1];
            vmapAd.AdSource[0] = adSource;
            vmap.AdBreak = new VMAPAdBreak[1];
            vmap.AdBreak[0] = vmapAd;
            return vmap;
        }