Пример #1
0
        internal override PropertyExpression Export([NotNull] ConditionGroup parent, [NotNull] IPropertyCollection propertyCollection)
        {
            var property   = propertyCollection.GetProperty(PropertyName);
            var expression = new PropertyExpression
            {
                Parent   = parent,
                Property = property
            };
            var dataExpr = expression.DataTypeExpression;

            dataExpr.SelectedCondition = Condition;
            if (Value != null)
            {
                var valueProperty = dataExpr.GetType().GetProperty("Value");
                valueProperty.SetValue(dataExpr, ConvertEx.SafeCastValue(Value, valueProperty.PropertyType));
            }
            return(expression);
        }