Ejemplo n.º 1
0
 public CInfoDynamicFieldAjoute(
     CTypeResultatExpression typePropriete,
     GetDynamicValueDelegate getDynamicValue,
     SetDynamicValueDelegate setDynamicValue,
     string strRubrique)
 {
     GetDynamicValue = getDynamicValue;
     SetDynamicValue = setDynamicValue;
     TypePropriete   = typePropriete;
     Rubrique        = strRubrique;
 }
Ejemplo n.º 2
0
        //---------------------------------------------------
        public static void RegisterDynamicField(
            Type tpSource,
            string strFieldName,
            CTypeResultatExpression typePropriete,
            GetDynamicValueDelegate getDynamicValue,
            SetDynamicValueDelegate setDynamicValue,
            string strRubrique
            )
        {
            Dictionary <string, CInfoDynamicFieldAjoute> dic = null;

            if (!m_dicTypeToFields.TryGetValue(tpSource, out dic))
            {
                dic = new Dictionary <string, CInfoDynamicFieldAjoute>();
                m_dicTypeToFields[tpSource] = dic;
            }
            if (!dic.ContainsKey(strFieldName))
            {
                dic[strFieldName] = new CInfoDynamicFieldAjoute(typePropriete, getDynamicValue, setDynamicValue, strRubrique);
            }
        }
        //------------------------------------------------------------
        public CResultAErreur GetValue(object objet, string strPropriete)
        {
            CResultAErreur result = CResultAErreur.True;

            if (objet == null)
            {
                return(result);
            }
            GetDynamicValueDelegate getValue = CGestionnaireProprietesAjoutees.GetGetDelegate(objet.GetType(), strPropriete);

            try
            {
                if (getValue != null)
                {
                    result.Data = getValue(objet);
                }
            }
            catch (Exception e)
            {
                result.EmpileErreur(new CErreurException(e));
            }
            return(result);
        }
 public COptimiseurProprieteAjoutee(GetDynamicValueDelegate delegue)
 {
     m_delegate = delegue;
 }