Esempio n. 1
0
        private void cbSupport_SelectedIndexChanged(object sender, EventArgs e)
        {
            SupportRadio valuesupportRd = null;
            SupportTV valuesupportTv = null;
            SupportPresse ValuesupportPr = null;

            string valueSupport = null;
            var valueMedia = cbMedia.SelectedItem.ToString();
            switch (cbMedia.SelectedIndex)
            {
                case 0:{
                        var listeDonne = new List<string>();
                        for (int i = 1; i < 20; i++)
                        {
                            listeDonne.Add(5 * i + " secondes");
                        }
                        cbFormat.DataSource = listeDonne;
                        valueSupport = ((SupportTV)cbSupport.SelectedValue).Libelle;
                        valuesupportTv = (SupportTV) cbSupport.SelectedValue;

                        break;
                    }

                case 1:
                    {
                        var listeDonne = new List<string>();
                        for (int i = 1; i < 20; i++)
                        {
                            listeDonne.Add(5 * i + " secondes");
                        }
                        cbFormat.DataSource = listeDonne;
                        valueSupport = ((SupportRadio)cbSupport.SelectedValue).Libelle;
                        valuesupportRd = (SupportRadio) cbSupport.SelectedValue;
                        break;
                    }

                case 2:
                    {
                        cbFormat.DataSource = Enum.GetValues(typeof(FormatPresse));

                        valueSupport = ((SupportPresse)cbSupport.SelectedValue).Libelle;
                        ValuesupportPr = (SupportPresse) cbSupport.SelectedValue;
                        break;
                    }
            }

            var valueFormat = cbFormat.SelectedItem.ToString();var valueListesLibelle = new List<String>();valueListesLibelle.AddRange(SupportTvs.Select(es => es.Libelle));
            valueListesLibelle.AddRange(SupportRadios.Select(es => es.Libelle));
            valueListesLibelle.AddRange(SupportPresses.Select(es => es.Libelle));
            var valueVague = (Vague)cbVague.SelectedItem;
            var valueFiltre = (Filter)cbFiltre.SelectedItem;
            var argument = new EventArgsMedia()
            {
                Support = valueSupport,
                Media = valueMedia,
                Format = valueFormat,
                Libelle = valueListesLibelle,

                filtre = valueFiltre,
                vague = valueVague,

                SupportPr = ValuesupportPr,
                SupportTv = valuesupportTv,
                SupportRd = valuesupportRd
            };
            var mediaEvent = ChangeMediaEvent;
            if (mediaEvent != null)
                mediaEvent(this, argument);
        }
Esempio n. 2
0
        private void cbVague_SelectedIndexChanged(object sender, EventArgs e)
        {
            SupportRadio valuesupportRd = null;
            SupportTV valuesupportTv = null;
            SupportPresse ValuesupportPr = null;

            string valueSupport = null;
            switch (cbMedia.SelectedIndex)
            {
                case 0:
                    {

                        valueSupport = ((SupportTV)cbSupport.SelectedValue).Libelle;

                        valuesupportTv = (SupportTV)cbSupport.SelectedValue;
                        break;
                    }

                case 1:
                    {

                        valueSupport = ((SupportRadio)cbSupport.SelectedValue).Libelle;
                        valuesupportRd = (SupportRadio)cbSupport.SelectedValue;
                        break;
                    }

                case 2:
                    {

                        valueSupport = ((SupportPresse)cbSupport.SelectedValue).Libelle;
                        ValuesupportPr = (SupportPresse)cbSupport.SelectedValue;
                        break;
                    }
            }
            string valueMedia;
            valueMedia = cbMedia.SelectedItem != null ? cbMedia.SelectedItem.ToString() : null;

            string valueFormat;
            valueFormat =cbFormat.SelectedItem!=null? cbFormat.SelectedItem.ToString(): null;

            var valueListesLibelle = new List<String>();
            valueListesLibelle.AddRange(SupportTvs.Select(es => es.Libelle));
            valueListesLibelle.AddRange(SupportRadios.Select(es => es.Libelle));
            valueListesLibelle.AddRange(SupportPresses.Select(es => es.Libelle));

            var valueVague=(Vague)cbVague.SelectedItem;
            var valueFiltre = (Filter)cbFiltre.SelectedItem;

            var argument = new EventArgsMedia()
            {
                Support = valueSupport,
                Media = valueMedia,
                Format = valueFormat,
                Libelle = valueListesLibelle,
                filtre = valueFiltre,
                vague = valueVague,

                SupportPr = ValuesupportPr,
                SupportTv = valuesupportTv,
                SupportRd = valuesupportRd
            };
            var mediaEvent = ChangeMediaEvent;
            if (mediaEvent != null)
                mediaEvent(this, argument);
        }
Esempio n. 3
0
 public void ChangementInsertion(object sender, EventArgsMedia e)
 {
     MediaAct = e.Media;
     supportAct = e.Support;
     FormatAct = e.Format;
     ListeLibelleAct = e.Libelle;
     vagueAct = e.vague;
     FiltreAct = e.filtre;
     supportTvAct = e.SupportTv;
     supportPrAct = e.SupportPr;
     supportRdAct = e.SupportRd;
 }