//------------------------------------------------------------------------- private void InitComboComportements() { CReferenceTypeFormBuiltIn refForm = CFormFinder.GetRefFormToEdit(typeof(CComportementGenerique)) as CReferenceTypeFormBuiltIn; if (m_cmbTypeElements.SelectedValue is Type) { m_cmbComportement.Init( typeof(CComportementGenerique), new CFiltreData(CComportementGenerique.c_champTypeElementCible + "=@1", m_cmbTypeElements.SelectedValue.ToString()), "Libelle", refForm != null?refForm.TypeForm:null, true); } else { m_cmbComportement.Init( typeof(CComportementGenerique), new CFiltreDataImpossible(), "Libelle", refForm != null ? refForm.TypeForm : null, true); m_cmbComportement.AssureRemplissage(); } }
//------------------------------------------------------------------------- private void InitPanelEvenements() { CReferenceTypeFormBuiltIn refTypeForm = CFormFinder.GetRefFormToEdit(typeof(CEvenement)) as CReferenceTypeFormBuiltIn; m_panelEvenements.InitFromListeObjets( m_definisseur.Evenements, typeof(CEvenement), refTypeForm != null ? refTypeForm.TypeForm : null, null, null); //S'il n'y a de navigateur, tout se passe en popup if (CFormNavigateurPopup.FindNavigateur(this) == null) { m_gestionnaireModeEdition.SetModeEdition(m_panelEvenements, TypeModeEdition.EnableSurEdition); m_panelEvenements.LockEdition = !m_gestionnaireModeEdition.ModeEdition; m_panelEvenements.AjouterElement = new CPanelListeSpeedStandard.AjouterElementDelegate(CreeEvenementPopup); m_panelEvenements.TraiterModificationElement = new CPanelListeSpeedStandard.ModifierElementDelegate(EditeEvenementPopup); } }
//---------------------------------------------------------------- public void Init(Type typeObjetPourForm) { if (typeObjetPourForm == m_typeObjets) { return; } m_typeObjets = typeObjetPourForm; List <CReferenceTypeForm> lstRefsTypes = new List <CReferenceTypeForm>(); // Init liste des formulaires standards List <CInfoClasseDynamique> lstForms = new List <CInfoClasseDynamique>(); // Cherche tous les formulaires d'édition correspondants au type foreach (Assembly ass in CGestionnaireAssemblies.GetAssemblies()) { foreach (Type tp in ass.GetTypes()) { if (!tp.IsAbstract && tp.IsSubclassOf(typeof(System.Windows.Forms.Form))) { Type tpEdite = null; string strLibelle = ""; object[] attribs = tp.GetCustomAttributes(typeof(ObjectEditeur), true); if (attribs.Length > 0) { ObjectEditeur attrib = (ObjectEditeur)attribs[0]; tpEdite = attrib.TypeEdite; strLibelle = DynamicClassAttribute.GetNomConvivial(tpEdite) + " - " + attrib.Code; } if (tpEdite == typeObjetPourForm && strLibelle != "") { CReferenceTypeFormBuiltIn refBin = new CReferenceTypeFormBuiltIn(tp); lstRefsTypes.Add(refBin); } } } } // Iinit liste des formulaires custom CListeObjetsDonnees lstFormulaires = new CListeObjetsDonnees(CSc2iWin32DataClient.ContexteCourant, typeof(CFormulaire)); lstFormulaires.Filtre = new CFiltreData( CFormulaire.c_champTypeElementEdite + " = @1 AND " + CFormulaire.c_champCodeRole + " is null", typeObjetPourForm.ToString()); foreach (CFormulaire formulaire in lstFormulaires) { //Elimine les formulaires en surimpression if (formulaire.Libelle.Contains(".")) { Type tp = CActivatorSurChaine.GetType(formulaire.Libelle); if (tp != null) { continue; } } CReferenceTypeFormDynamic refDync = new CReferenceTypeFormDynamic(formulaire); lstRefsTypes.Add(refDync); } m_comboRefTypeForm.Fill( lstRefsTypes, "Libelle", true); m_comboRefTypeForm.AssureRemplissage(); if (m_typeSelectionne != null) { m_comboRefTypeForm.SelectedValue = m_typeSelectionne; } }