Beispiel #1
0
        private VASTADInLineCreativeLinear GenerarCreativeLinear(VideoClicks_type video_clicks,
                                                                 VASTADInLineCreativeLinearMediaFile[] media_files)
        {
            //Calculo de duración
            int segundos_input = 0;
            int segundos       = 0;
            int minutos        = 0;

            int.TryParse(txtDurationLinear.Text, out segundos_input);
            if (segundos == 0)
            {
                segundos = DURACION_DEFAULT_LINEAR_CREATIVE;
            }

            ConvertirSegundosAMinutosSegundos(segundos_input, out minutos, out segundos);

            var linear_ad_item_creative_linear = new VASTADInLineCreativeLinear
            {
                //Duration = new DateTime(segundos * SEC_VALUE_IN_TICKS, DateTimeKind.Local),
                //TODO: Agregar la siguiente linea cuando agregue TrackingEvents
                //TrackingEvents = trackingEvents,
                //Duration = DateTime.Parse("00:00:" + segundos.ToString()),
                Duration = "00:" + minutos.ToString("00", CultureInfo.CurrentCulture) + ":" +
                           segundos.ToString("00", CultureInfo.CurrentCulture),
                VideoClicks = video_clicks,
                MediaFiles  = media_files
            };

            return(linear_ad_item_creative_linear);
        }
Beispiel #2
0
        private VideoClicks_type GenerarVideoClicks_Type()
        {
            //Revision Inicial
            if (!System.Uri.IsWellFormedUriString(txtClickthroughValue.Text, UriKind.Absolute) && chkIncluirClickthrough.Checked == true)
            {
                throw new InvalidDataException("El URI proporcionado para el ClickThrough no es valido");
            }
            if (!System.Uri.IsWellFormedUriString(txtClickTrackerValue.Text, UriKind.Absolute) && chkIncluirClickTracker.Checked == true)
            {
                throw new InvalidDataException("El URI proporcionado para el Click Tracker no es valido");
            }

            var video_click_through = new VideoClicks_typeClickThrough
            {
                id    = txtClickthroughID.Text,
                Value = txtClickthroughValue.Text
            };

            //Click Tracking -  TODO: Que se pueda poner más de uno
            VideoClicks_typeClickTracking[] video_click_trackings = new VideoClicks_typeClickTracking[]
            {
                new VideoClicks_typeClickTracking
                {
                    id    = txtClickTrackerID.Text,
                    Value = txtClickTrackerValue.Text
                }
            };

            VideoClicks_type video_clicks = new VideoClicks_type
            {
                ClickThrough  = video_click_through,
                ClickTracking = video_click_trackings
            };

            return(video_clicks);
        }