//--------------------------------------------------------------------------------------------------------- public void Init(ISourceEntitesPourTableDataHotel source, CODEQTableFromDataHotel table) { m_table = table; if (source == null) { m_sourceEnCours = new CSourceEntitesPourTableDataHotelFormule(); } else { m_sourceEnCours = source; } List <CCoupleTypeLibelle> lstCouples = new List <CCoupleTypeLibelle>(); CCoupleTypeLibelle coupleSel = null; foreach (Type tp in TypesEditeurs) { CCoupleTypeLibelle couple = new CCoupleTypeLibelle(tp, GetLibelleTypeSource(tp)); if (tp == m_sourceEnCours.GetType()) { coupleSel = couple; } lstCouples.Add(couple); } m_cmbTypeSource.ProprieteAffichee = "Libelle"; m_cmbTypeSource.ListDonnees = lstCouples; m_cmbTypeSource.SelectedValue = coupleSel; UpdateAspect(); }
//--------------------------------------------------------------------------------------------------------- private void m_cmbTypeSource_SelectionChangeCommitted(object sender, EventArgs e) { CCoupleTypeLibelle couple = m_cmbTypeSource.SelectedValue as CCoupleTypeLibelle; Type tp = couple != null ? couple.TypeSource : null; if (tp == null) { return; } if (m_sourceEnCours == null || m_sourceEnCours.GetType() != tp) { m_sourceEnCours = Activator.CreateInstance(tp) as ISourceEntitesPourTableDataHotel; } UpdateAspect(); }