예제 #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);
        }
예제 #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);
        }
예제 #3
0
 public static DataInfo ObjGetDataInfo <T>(this object _object, Expression <Func <T, object> > expression)
 {
     return(ObjGetDataInfo(_object, Reflected.ObjGetPropertyPath <T>(expression)));
 }
예제 #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);
        }
예제 #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());
        }