Ejemplo n.º 1
0
        internal StaticProperty(PropertyInfo propertyInfo)
            : base(propertyInfo)
        {
            _getValueAsStaticLooselyTypedExpression = new Lazy<Expression<Func<object>>>(() => ExpressionFactory.CreateStaticGetValueFuncExpression(propertyInfo));
            _setValueAsStaticLooselyTypedExpression = new Lazy<Expression<Action<object>>>(() => ExpressionFactory.CreateStaticSetValueActionExpression(propertyInfo));
            _getValueAsStaticStronglyTypedExpression = new Lazy<Expression<Func<TPropertyType>>>(() => ExpressionFactory.CreateStaticGetValueFuncExpression<TPropertyType>(propertyInfo));
            _setValueAsStaticStronglyTypedExpression = new Lazy<Expression<Action<TPropertyType>>>(() => ExpressionFactory.CreateStaticSetValueActionExpression<TPropertyType>(propertyInfo));

            _getValueAsStaticLooselyTyped = new Lazy<Func<object>>(() => _getValueAsStaticLooselyTypedExpression.Value.Compile());
            _setValueAsStaticLooselyTyped = new Lazy<Action<object>>(() => _setValueAsStaticLooselyTypedExpression.Value.Compile());
            _getValueAsStaticStronglyTyped = new Lazy<Func<TPropertyType>>(() => _getValueAsStaticStronglyTypedExpression.Value.Compile());
            _setValueAsStaticStronglyTyped = new Lazy<Action<TPropertyType>>(() => _setValueAsStaticStronglyTypedExpression.Value.Compile());
        }
Ejemplo n.º 2
0
        internal StaticField(FieldInfo fieldInfo) : base(fieldInfo)
        {
            _getValueAsStaticLooselyTypedExpression  = new Lazy <Expression <Func <object> > >(() => ExpressionFactory.CreateStaticGetValueFuncExpression(fieldInfo));
            _setValueAsStaticLooselyTypedExpression  = new Lazy <Expression <Action <object> > >(() => ExpressionFactory.CreateStaticSetValueActionExpression(fieldInfo));
            _getValueAsStaticStronglyTypedExpression = new Lazy <Expression <Func <TFieldType> > >(() => ExpressionFactory.CreateStaticGetValueFuncExpression <TFieldType>(fieldInfo));
            _setValueAsStaticStronglyTypedExpression = new Lazy <Expression <Action <TFieldType> > >(() => ExpressionFactory.CreateStaticSetValueActionExpression <TFieldType>(fieldInfo));

            _getValueAsStaticLooselyTyped  = new Lazy <Func <object> >(() => _getValueAsStaticLooselyTypedExpression.Value.Compile());
            _setValueAsStaticLooselyTyped  = new Lazy <Action <object> >(() => _setValueAsStaticLooselyTypedExpression.Value.Compile());
            _getValueAsStaticStronglyTyped = new Lazy <Func <TFieldType> >(() => _getValueAsStaticStronglyTypedExpression.Value.Compile());
            _setValueAsStaticStronglyTyped = new Lazy <Action <TFieldType> >(() => _setValueAsStaticStronglyTypedExpression.Value.Compile());
        }