Beispiel #1
0
        //---------------------------------------------------
        public static SetDynamicValueDelegate GetSetDelegate(Type tp, string strField)
        {
            CInfoDynamicFieldAjoute info = GetInfo(tp, strField);

            if (info != null)
            {
                return(info.SetDynamicValue);
            }
            return(null);
        }
Beispiel #2
0
        //---------------------------------------------------
        public static CInfoDynamicFieldAjoute GetInfo(Type tp, string strField)
        {
            Dictionary <string, CInfoDynamicFieldAjoute> dic = null;

            if (m_dicTypeToFields.TryGetValue(tp, out dic))
            {
                CInfoDynamicFieldAjoute info = null;
                if (dic.TryGetValue(strField, out info))
                {
                    return(info);
                }
            }
            return(null);
        }
Beispiel #3
0
        //---------------------------------------------------
        public static GetDynamicValueDelegate GetGetDelegate(Type tp, string strField)
        {
            CInfoDynamicFieldAjoute info = null;

            while (tp != null)
            {
                info = GetInfo(tp, strField);
                if (info != null)
                {
                    return(info.GetDynamicValue);
                }
                tp = tp.BaseType;
            }
            return(null);
        }
 public CDefinitionProprieteDynamiqueAjoutee(
     Type tpSource,
     string strField,
     CInfoDynamicFieldAjoute info,
     bool bHasSubProprietes,
     string strRubrique)
     :
     base(
         strField,
         strField,
         info.TypePropriete,
         bHasSubProprietes,
         info.SetDynamicValue == null,
         strRubrique)
 {
 }
Beispiel #5
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);
            }
        }