Exemple #1
0
        //-----------------------------------------------------------------
        private void itemAddMenu_Click(object sender, EventArgs args)
        {
            CModeleTexte modele = new CModeleTexte(CSc2iWin32DataClient.ContexteCourant);

            modele.CreateNew();
            modele.TypeAssocie = TypeObjet;
            if (CFormPopupEditeModeleTexte.EditeModele(modele))
            {
                CResultAErreur result = modele.CommitEdit();
                if (!result)
                {
                    CFormAlerte.Afficher(result.Erreur.ToString(), EFormAlerteType.Erreur);
                }
                else
                {
                    CTimosAppRegistre.SetModeleTexteForType(ModeleTexte, Contexte, TypeObjet);
                }
            }
            else
            {
                if (ModeleTexte != null)
                {
                    ModeleTexte.CancelEdit();
                }
            }
        }
Exemple #2
0
        //-----------------------------------------------------------------
        private void itemEditMenu_Click(object sender, EventArgs args)
        {
            CModeleTexte modele = ModeleTexte;

            if (modele != null)
            {
                modele.BeginEdit();
                if (CFormPopupEditeModeleTexte.EditeModele(modele))
                {
                    modele.CommitEdit();
                    CTimosAppRegistre.SetModeleTexteForType(ModeleTexte, Contexte, TypeObjet);
                }
                else
                {
                    modele.CancelEdit();
                }
            }
        }
Exemple #3
0
 //-----------------------------------------------------------------
 void menuModele_MouseUp(object sender, MouseEventArgs e)
 {
     if ((e.Button & MouseButtons.Right) == MouseButtons.Right)
     {
         CModeleTexte modele = ModeleTexte;
         if (modele != null)
         {
             modele.BeginEdit();
             if (CFormPopupEditeModeleTexte.EditeModele(modele))
             {
                 modele.CommitEdit();
                 CTimosAppRegistre.SetModeleTexteForType(ModeleTexte, Contexte, TypeObjet);
             }
             else
             {
                 modele.CancelEdit();
             }
         }
     }
     else
     {
         CTimosAppRegistre.SetModeleTexteForType(ModeleTexte, Contexte, TypeObjet);
     }
 }