Esempio n. 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);
        }
Esempio n. 2
0
        //-----------------------------------
        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);
        }
Esempio n. 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);
                        }
                    }
                }
            }
        }
Esempio n. 5
0
        //---------------------------------------------------------------------------
        /// <summary>
        /// Remplace la fonction de sélection dans C2iTextBoxFiltreRapide
        /// </summary>
        /// <param name="typeObjets"></param>
        /// <param name="filtreRapide"></param>
        /// <param name="strRechercheRapide"></param>
        /// <param name="bSelectionPriseEnCharge"></param>
        /// <returns></returns>
        public static CObjetDonnee MySelectionneurObjetRapide(
            Type typeObjets,
            CFiltreData filtreDeBase,
            string strRechercheRapide,
            ref bool bSelectionPriseEnCharge)
        {
            if (bSelectionPriseEnCharge)
            {
                return(null);
            }
            Type typeForm = CFormFinder.GetTypeFormToList(typeObjets);

            bSelectionPriseEnCharge = typeForm != null && typeof(CFormListeStandard).IsAssignableFrom(typeForm);
            if (!bSelectionPriseEnCharge)
            {
                return(null);
            }
            CFormListeStandard frmListe = (CFormListeStandard)Activator.CreateInstance(typeForm, null);

            frmListe.FiltreDeBase = filtreDeBase;
            frmListe.FiltreRapide = CFournisseurFiltreRapide.GetFiltreRapideForType(typeObjets);
            if (frmListe.ListeObjets != null)
            {
                frmListe.ListeObjets.FiltrePrincipal = filtreDeBase;
            }

            Thread th = new Thread(new ThreadStart(SelectOnSTAThread));

            th.SetApartmentState(ApartmentState.STA);
            m_formForThread = frmListe;
            m_strTextRechercheRapideForThread = strRechercheRapide;
            m_objetSelectedByThread           = null;
            th.Start();
            th.Join();
            return(m_objetSelectedByThread);
        }