예제 #1
0
        internal override PropertyExpression Export([NotNull] ConditionGroup parent, [NotNull] IPropertyCollection propertyCollection)
        {
            var property           = propertyCollection.GetProperty(PropertyName);
            var propertyExpression = new PropertyExpression
            {
                Parent   = parent,
                Property = property
            };
            var dataTypeExpression = propertyExpression.DataTypeExpression;

            dataTypeExpression.SelectedCondition = Condition.Matches;


            var reflectionService = this.GetDependencyResolver().Resolve <IReflectionService>();
            var properties        = reflectionService.GetInstanceProperties(property.Type);
            var group             = new ConditionGroup()
            {
                Type = ConditionGroupType.And
            };

            Conditions.Select(o => o.Export(group, properties)).Sink(group.Items.Add);

            ((ComplexTypeExpression)dataTypeExpression).Value = new FilterScheme(property.Type, "Default", group);
            return(propertyExpression);
        }
예제 #2
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);
        }
예제 #3
0
 public T GetProperty <T>(string key)
 {
     return(_propertyCollection.GetProperty <T>(key));
 }
예제 #4
0
 /// <summary>
 /// Gets attributes of the node. Cannot return <c>null</c>, gets empty collection instead.
 /// </summary>
 public static IReadOnlyList <IAttributeElement> GetAttributes(this IPropertyCollection node)
 {
     return(node.GetProperty <IReadOnlyList <IAttributeElement> >() ?? ArrayUtils.Empty <IAttributeElement>());
 }
예제 #5
0
 /// <summary>
 /// Gets <see cref="PHPDocBlock"/> associated with <paramref name="properties"/>.
 /// </summary>
 public static IDocBlock GetPHPDoc(this IPropertyCollection /*!*/ properties)
 {
     return(properties.GetProperty <IDocBlock>());
 }