Exemplo n.º 1
0
        public static PropertyDataInfo GetInfo <T>(T context, Expression <Func <T, object> > binding)
        {
            DataInfo dataInfo = Reflected.ObjGetDataInfo <T>(context, binding);

            if (dataInfo.DataInfoType == EDataInfoType.FieldInfo)
            {
                throw new Exception("Invalid property queried");
            }

            PropertyDataInfo result = new PropertyDataInfo();

            result.PropertyInfo = (PropertyInfo)dataInfo.PropertyFieldInfo;
            result.Context      = dataInfo.Context;
            return(result);
        }
Exemplo n.º 2
0
        public static FieldDataInfo Register <T>(T context, string binding)
        {
            FieldDataInfo obj      = new FieldDataInfo();
            DataInfo      dataInfo = Reflected.ObjGetDataInfo(context, binding);

            if (dataInfo.DataInfoType == EDataInfoType.PropertyInfo)
            {
                throw new Exception("Invalid field queried");
            }

            FieldDataInfo result = new FieldDataInfo();

            result.FieldInfo = (FieldInfo)dataInfo.PropertyFieldInfo;
            result.Context   = dataInfo.Context;
            return(result);
        }
Exemplo n.º 3
0
 public static DataInfo ObjGetDataInfo <T>(this object _object, Expression <Func <T, object> > expression)
 {
     return(ObjGetDataInfo(_object, Reflected.ObjGetPropertyPath <T>(expression)));
 }
Exemplo n.º 4
0
        public static void ObjSetDataValue <T>(this T _object, Expression <Func <T, object> > expression, object value)
        {
            DataInfo dataInfo = Reflected.ObjGetDataInfo <T>(_object, expression);

            dataInfo.SetValue(value);
        }
Exemplo n.º 5
0
        public static object ObjGetDataValue <T>(this object _object, Expression <Func <T, object> > expression)
        {
            DataInfo dataInfo = Reflected.ObjGetDataInfo <T>(_object, expression);

            return(dataInfo.GetValue());
        }