private static CResultAErreur DeclencheEvenement( IControleWndFor2iWnd ctrl, CHandlerEvenementParFormule handler) { CResultAErreur result = CResultAErreur.True; try { if (handler.FormuleEvenement != null) { IControleWndFor2iWnd ctrlParent = ctrl; while (ctrlParent.WndContainer != null && !ctrlParent.IsRacineForEvenements) { ctrlParent = ctrlParent.WndContainer as IControleWndFor2iWnd; } CContexteEvaluationExpression ctx = new CContexteEvaluationExpression(new CEncaspuleurControleWndForFormules(ctrlParent)); result = handler.FormuleEvenement.Eval(ctx); if (ctrl.Control != null) { ctrl.Control.Refresh(); } } } catch (Exception e) { result.EmpileErreur(new CErreurException(e)); } return(result); }
public void Init( C2iWnd wnd, CDescriptionEvenementParFormule descriptionEvenement, IFournisseurProprietesDynamiques fournisseur) { m_wndEditee = wnd; m_descriptionEvenement = descriptionEvenement; m_lblNomEvenement.Text = m_descriptionEvenement.NomEvenement; m_tooltip.SetToolTip(m_lblNomEvenement, m_descriptionEvenement.DescriptionEvenement); CHandlerEvenementParFormule handler = wnd.GetHandler(descriptionEvenement.IdEvenement); if (handler == null) { m_txtEditFormule.Formule = null; } else { m_txtEditFormule.Formule = handler.FormuleEvenement; } C2iWnd parent = wnd; while (parent.Parent as C2iWnd != null) { parent = parent.Parent as C2iWnd; } m_txtEditFormule.Init(fournisseur, new CObjetPourSousProprietes(parent)); }
private void m_txtEditFormule_Leave(object sender, EventArgs e) { if (m_wndEditee != null) { CHandlerEvenementParFormule handler = new CHandlerEvenementParFormule( m_descriptionEvenement.IdEvenement, m_txtEditFormule.Formule); m_wndEditee.SetHandler(handler); } }
public static CResultAErreur DeclencheEvenement( string strIdEvenement, IControleWndFor2iWnd ctrl) { CHandlerEvenementParFormule handler = null; if (ctrl != null && ctrl.WndAssociee != null) { handler = ctrl.WndAssociee.GetHandler(strIdEvenement); if (handler != null) { return(CUtilControlesWnd.DeclencheEvenement(ctrl, handler)); } } return(CResultAErreur.True); }