コード例 #1
0
ファイル: VMAPConverter.cs プロジェクト: tcns/impulse
        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;
        }
コード例 #2
0
ファイル: OutboundService.cs プロジェクト: tcns/impulse
        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;
        }