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); }
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); }
public T GetProperty <T>(string key) { return(_propertyCollection.GetProperty <T>(key)); }
/// <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>()); }
/// <summary> /// Gets <see cref="PHPDocBlock"/> associated with <paramref name="properties"/>. /// </summary> public static IDocBlock GetPHPDoc(this IPropertyCollection /*!*/ properties) { return(properties.GetProperty <IDocBlock>()); }