public FilterLambdaOperatorParameters CreateFilter(ItemFilterGroupParameters itemFilterGroup, Type modelType, object entity) => new FilterLambdaOperatorParameters ( CreateFilterGroupBody(itemFilterGroup, entity), modelType, parameterName );
public DummyItemGroupConstructor ( MemberSourceFilterParameters memberSourceFilterParameters, ValueSourceFilterParameters valueSourceFilterParameters, ItemFilterGroupParameters itemFilterGroupParameters ) { }
public DataFormSettingsParameters ( [NameValue(AttributeNames.DEFAULTVALUE, "Title")] [Comments("Header field on the form")] string title, [Comments("Input validation messages for each field.")] List <ValidationMessageParameters> validationMessages, [Comments("List of fields and form groups for this form.")] List <FormItemSettingsParameters> fieldSettings, [Comments("Click the Variable button and select the configured FormType enum field.")] FormType formType, [Comments("The model type for the object being edited. Click the function button and use the configured GetType function. Use the Assembly qualified type name for the type argument.")] Type modelType, [Comments("Multibindings list for the form header field - typically used in edit mode.")] MultiBindingParameters headerBindings = null, [Comments("Includes the URL's for create, read, and update.")] FormRequestDetailsParameters requestDetails = null, [Comments("Conditional directtives for each field.")] List <VariableDirectivesParameters> conditionalDirectives = null, [Comments("Multibindings list for the form header field.")] MultiBindingParameters subtitleBindings = null, [Comments("Defines a filter to find a selected item on a subsequent form e.g. to edit the selected item.")] ItemFilterGroupParameters itemFilterGroup = null ) { Title = title; RequestDetails = requestDetails; ValidationMessages = validationMessages.ToDictionary ( vm => vm.Field, vm => vm.Rules ?? new List <ValidationRuleParameters>() ); FieldSettings = fieldSettings; FormType = formType; ModelType = modelType; ConditionalDirectives = conditionalDirectives?.ToDictionary ( cd => cd.Field, cd => cd.ConditionalDirectives ?? new List <DirectiveParameters>() ); HeaderBindings = headerBindings; SubtitleBindings = subtitleBindings; ItemFilterGroup = itemFilterGroup; }
public SearchFormSettingsParameters ( [NameValue(AttributeNames.DEFAULTVALUE, "Title")] [Comments("Header field on the form")] string title, [Comments("The element type for a list item. Click the function button and use the configured GetType function. Use the Assembly qualified type name for the type argument.")] Type modelType, [Comments("Loading text may be useful.")] [NameValue(AttributeNames.DEFAULTVALUE, "Lodding ...")] string loadingIndicatorText, [Comments("XAML template name for the collection view item template.")] [Domain("HeaderTextDetailTemplate, TextDetailTemplate")] [NameValue(AttributeNames.DEFAULTVALUE, "HeaderTextDetailTemplate")] string itemTemplateName, [Comments("Placeholder text for the search bar.")] [NameValue(AttributeNames.DEFAULTVALUE, "Filter")] string filterPlaceholder, [Comments("Defines which fields of the model type which bind to the named template fields (e.g. Header, Text, Detail).")] List <ItemBindingParameters> bindings, [Comments("Define the sort order and number additional items to return on 'Pull to Refresh'.")] SortCollectionParameters sortCollection, [Comments("Defines the fields to search against - may be different from the displayed template fields.")] SearchFilterGroupParameters searchFilterGroup, [Comments("Defines a filter to find a selected item on a subsequent form e.g. to edit the selected item.")] ItemFilterGroupParameters itemFilterGroup, [Comments("Defines API URL for the list data. May specify model and data types if we use the URL for multiple types.")] RequestDetailsParameters requestDetails ) { Title = title; ModelType = modelType; LoadingIndicatorText = loadingIndicatorText; ItemTemplateName = itemTemplateName; FilterPlaceholder = filterPlaceholder; Bindings = bindings.ToDictionary(cvib => cvib.Name); SortCollection = sortCollection; SearchFilterGroup = searchFilterGroup; ItemFilterGroup = itemFilterGroup; RequestDetails = requestDetails; }
private static IExpressionParameter CreateFilterGroupBody(ItemFilterGroupParameters itemFilterGroup, object entity) { if (itemFilterGroup?.Filters?.Any() != true) { throw new ArgumentException($"{nameof(itemFilterGroup.Filters)}: 937A1CD2-9253-4E5D-81E9-D36DFD036861"); } if (itemFilterGroup.Filters.Count > 2) { throw new ArgumentException($"{nameof(itemFilterGroup.Filters)}: E1D1CCC2-15CA-472F-BF20-F92CC76B27FD"); } if (itemFilterGroup.Filters.Count == 1) { return(CreateBody(itemFilterGroup.Filters.First())); } ; return(SetMembers ( GetLogicBinaryOperatorParameters(itemFilterGroup.Logic) )); IExpressionParameter SetMembers(BinaryOperatorParameters binaryOperator) { binaryOperator.Left = CreateBody(itemFilterGroup.Filters.First()); binaryOperator.Right = CreateBody(itemFilterGroup.Filters.Last()); return(binaryOperator); } IExpressionParameter CreateBody(ItemFilterParametersBase filterBase) => filterBase switch { ValueSourceFilterParameters valueSourceFilter => CreateValueFilterBody(valueSourceFilter), MemberSourceFilterParameters memberSourceFilter => CreateMemberSourceFilterBody(memberSourceFilter, entity), ItemFilterGroupParameters itemFilterGroup => CreateFilterGroupBody(itemFilterGroup, entity), _ => throw new ArgumentException($"{nameof(filterBase)}: AB31632F-4961-435C-8BA2-528CBCBEAE88"), }; }
private static IExpressionParameter CreateFilterGroupBody(ItemFilterGroupParameters itemFilterGroup, object entity) { if (itemFilterGroup?.Filters?.Any() != true) { throw new ArgumentException($"{nameof(itemFilterGroup.Filters)}: 1D51E748-1CFE-4C6D-8827-FB2A12691AA9"); } if (itemFilterGroup.Filters.Count > 2) { throw new ArgumentException($"{nameof(itemFilterGroup.Filters)}: 5A4E1048-A4A2-4401-8237-24B0AC961643"); } if (itemFilterGroup.Filters.Count == 1) { return(CreateBody(itemFilterGroup.Filters.First())); } ; return(SetMembers ( GetLogicBinaryOperatorParameters(itemFilterGroup.Logic) )); IExpressionParameter SetMembers(BinaryOperatorParameters binaryOperator) { binaryOperator.Left = CreateBody(itemFilterGroup.Filters.First()); binaryOperator.Right = CreateBody(itemFilterGroup.Filters.Last()); return(binaryOperator); } IExpressionParameter CreateBody(ItemFilterParametersBase filterBase) => filterBase switch { ValueSourceFilterParameters valueSourceFilter => CreateValueFilterBody(valueSourceFilter), MemberSourceFilterParameters memberSourceFilter => CreateMemberSourceFilterBody(memberSourceFilter, entity), ItemFilterGroupParameters itemFilterGroup => CreateFilterGroupBody(itemFilterGroup, entity), _ => throw new ArgumentException($"{nameof(filterBase)}: F80C8C40-EE3B-4020-BAB0-B580625E48AE"), }; }
public DummyFormParameterConstructor ( CommandButtonParameters commandButtonParameters, FormControlSettingsParameters formControlSettingsParameters, FormGroupArraySettingsParameters formGroupArraySettingsParameters, FormGroupSettingsParameters formGroupSettingsParameters, FormGroupBoxSettingsParameters groupBoxSettingsParameters, MultiSelectFormControlSettingsParameters multiSelectFormControlSettingsParameters, SearchFilterGroupParameters searchFilterGroupParameters, SearchFilterParameters searchFilterParameters, ItemFilterGroupParameters itemFilterGroupParameters, MemberSourceFilterParameters memberSourceFilterParameters, ValueSourceFilterParameters valueSourceFilterParameters, FormattedLabelItemParameters formattedLabelItemParameters, HyperLinkLabelItemParameters hyperLinkLabelItemParameters, LabelItemParameters labelItemParameters, HyperLinkSpanItemParameters hyperLinkSpanItemParameters, SpanItemParameters spanItemParameters, MultiSelectItemBindingParameters multiSelectItemBindingParameters, DropDownItemBindingParameters dropDownItemBindingParameters, TextItemBindingParameters textItemBindingParameters ) { }