Example #1
0
        //---------------------------------------------------------------------------
        private CFormEditionStandard NewCFormEdition(CObjetDonneeAIdNumeriqueAuto objet, CListeObjetsDonnees liste)
        {
            if (m_strProprieteObjetAEditer.Trim() != "")
            {
                objet = (CObjetDonneeAIdNumeriqueAuto)CInterpreteurTextePropriete.GetValue(objet, m_strProprieteObjetAEditer);
                liste = liste.GetDependances(m_strProprieteObjetAEditer);
            }
            CFormEditionStandard frm = null;

            // YK 20/02/09 : On utilise ici le nouveau CFormFinder
            if (m_referenceForm == null)
            {
                m_referenceForm = CFormFinder.GetRefFormToEdit(m_typeObjet);
            }
            if (m_referenceForm != null)
            {
                frm = (CFormEditionStandard)m_referenceForm.GetForm(objet, liste);
            }
            if (frm != null)
            {
                if (AfterCreateFormEdition != null)
                {
                    AfterCreateFormEdition(this, frm);
                }
                frm.AfterSuppression            += new ObjetDonneeEventHandler(OnSuppressionDansFormEdition);
                frm.AfterValideModification     += new ObjetDonneeEventHandler(OnValidationDansFormEdition);
                frm.AfterAnnulationModification += new ObjetDonneeEventHandler(OnAnnulationDansFormEdition);
            }
            return(frm);
        }
        //-----------------------------------
        private CReferenceTypeForm GetTypeFormToEdit(Type typeObjet)
        {
            CReferenceTypeForm refTypeForm = null;

            if (!m_dicTypeObjetToTypeFormEdition.TryGetValue(typeObjet, out refTypeForm))
            {
                refTypeForm = CFormFinder.GetRefFormToEdit(typeObjet);
                m_dicTypeObjetToTypeFormEdition[typeObjet] = refTypeForm;
            }
            return(refTypeForm);
        }
Example #3
0
        private void AfficheElement(IObjetHierarchiqueACodeHierarchique objet)
        {
            //Type typeForm = CFormFinder.GetTypeFormToEdit(objet.GetType());
            //if (typeForm == null || !typeForm.IsSubclassOf(typeof(CFormEditionStandard)))
            //    return;
            //CFormEditionStandard form = (CFormEditionStandard)Activator.CreateInstance(typeForm, new object[] { objet });
            //CTimosApp.Navigateur.AffichePage(form);
            CReferenceTypeForm refTypeForm = CFormFinder.GetRefFormToEdit(objet.GetType());

            if (refTypeForm != null)
            {
                CFormEditionStandard form = refTypeForm.GetForm((CObjetDonneeAIdNumeriqueAuto)objet) as CFormEditionStandard;
                if (form != null)
                {
                    CSc2iWin32DataNavigation.Navigateur.AffichePage(form);
                }
            }
        }
        //------------------------------------------------------------------
        private void m_linkControl_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
        {
            CObjetDonneeAIdNumeriqueAuto obj = this.ElementSelectionne as CObjetDonneeAIdNumeriqueAuto;

            if (obj == null)
            {
                return;
            }
            Type typeForm = m_typeFormEdition;

            //if ( typeForm == null && ElementSelectionne != null )
            //    typeForm = CFormFinder.GetRefFormToEdit ( ElementSelectionne.GetType() );
            if (ElementSelectionne != null)
            {
                CFormEditionStandard form;
                if (typeForm != null)
                {
                    form = (CFormEditionStandard)Activator.CreateInstance(
                        typeForm,
                        new object[] { obj });
                    CSc2iWin32DataNavigation.Navigateur.AffichePage(form);
                }
                else
                {
                    CReferenceTypeForm refTypeForm = CFormFinder.GetRefFormToEdit(ElementSelectionne.GetType());
                    if (refTypeForm != null)
                    {
                        form = refTypeForm.GetForm(obj) as CFormEditionStandard;
                        if (form != null)
                        {
                            CSc2iWin32DataNavigation.Navigateur.AffichePage(form);
                        }
                    }
                }
            }
        }