public List <ValidateIf <TModel> > GetConditions <TModel>(IFormGroupSettings formGroupSettings, IEnumerable <IValidatable> properties)
 => new ValidateIfConditionalDirectiveHelper <TModel>
 (
     formGroupSettings,
     properties,
     mapper
 ).GetConditions();
 public List <HideIf <TModel> > GetConditions <TModel>(IFormGroupSettings formGroupSettings, IEnumerable <IFormField> properties)
 => new HideIfConditionalDirectiveHelper <TModel>
 (
     formGroupSettings,
     properties,
     mapper
 ).GetConditions();
 public FieldsCollectionHelper(IFormGroupSettings formSettings, ObservableCollection <IValidatable> properties, UiNotificationService uiNotificationService, IHttpService httpService, IMapper mapper)
 {
     this.formSettings          = formSettings;
     this.properties            = properties;
     this.uiNotificationService = uiNotificationService;
     this.httpService           = httpService;
     this.mapper = mapper;
 }
Beispiel #4
0
 public ReloadIfConditionalDirectiveHelper(IFormGroupSettings formGroupSettings,
                                           IEnumerable <IFormField> properties,
                                           IMapper mapper,
                                           List <ReloadIf <TModel> > parentList = null,
                                           string parentName = null)
     : base(formGroupSettings, properties, mapper, parentList, parentName)
 {
 }
 private ObservableCollection <IValidatable> CreateValidatablesFormSettings(IFormGroupSettings formSettings, Type modelType)
 {
     return(serviceProvider.GetRequiredService <IFieldsCollectionBuilder>().CreateFieldsCollection
            (
                formSettings,
                modelType
            ).Properties);
 }
Beispiel #6
0
 public BaseConditionalDirectiveHelper(IFormGroupSettings formGroupSettings, IEnumerable <IFormField> properties, IMapper mapper, List <TConditionBase> parentList = null, string parentName = null)
 {
     this.formGroupSettings = formGroupSettings;
     this.properties        = properties;
     this.mapper            = mapper;
     this.parentList        = parentList;
     this.parentName        = parentName;
 }
 public ValidateIfConditionalDirectiveHelper(IFormGroupSettings formGroupSettings, IEnumerable <IValidatable> properties, IMapper mapper, List <ValidateIf <TModel> > parentList = null, string parentName = null)
 {
     this.mapper            = mapper;
     this.parentList        = parentList;
     this.parentName        = parentName;
     this.formGroupSettings = formGroupSettings;
     this.properties        = properties;
 }
Beispiel #8
0
        public DirectiveManagers(ObservableCollection <IValidatable> properties, IFormGroupSettings formSettings, IContextProvider contextProvider)
        {
            this.properties   = properties;
            this.formSettings = formSettings;

            this.validateIfManager = new ValidateIfManager <TModel>
                                     (
                this.properties,
                contextProvider.ConditionalValidationConditionsBuilder.GetConditions <TModel>
                (
                    this.formSettings,
                    this.properties
                ),
                contextProvider.Mapper,
                contextProvider.UiNotificationService
                                     );

            this.hideIfManager = new HideIfManager <TModel>
                                 (
                this.properties,
                contextProvider.HideIfConditionalDirectiveBuilder.GetConditions <TModel>
                (
                    this.formSettings,
                    this.properties
                ),
                contextProvider.Mapper,
                contextProvider.UiNotificationService
                                 );

            this.clearIfManager = new ClearIfManager <TModel>
                                  (
                this.properties,
                contextProvider.ClearIfConditionalDirectiveBuilder.GetConditions <TModel>
                (
                    this.formSettings,
                    this.properties
                ),
                contextProvider.Mapper,
                contextProvider.UiNotificationService
                                  );

            this.reloadIfManager = new ReloadIfManager <TModel>
                                   (
                this.properties,
                contextProvider.ReloadIfConditionalDirectiveBuilder.GetConditions <TModel>
                (
                    this.formSettings,
                    this.properties
                ),
                contextProvider.Mapper,
                contextProvider.UiNotificationService
                                   );
        }
        private ObservableCollection <IValidatable> CreateValidatablesFromSettings(IFormGroupSettings formSettings)
        {
            ObservableCollection <IValidatable> properties = new ObservableCollection <IValidatable>();

            new FieldsCollectionHelper
            (
                formSettings,
                properties,
                new UiNotificationService(),
                new HttpServiceMock(),
                serviceProvider.GetRequiredService <IMapper>()
            ).CreateFieldsCollection();

            return(properties);
        }
 public EditFormLayout CreateFieldsCollection(IFormGroupSettings formSettings, Type modelType)
 => new UpdateOnlyFieldsCollectionHelper(formSettings.FieldSettings, formSettings, formSettings.ValidationMessages, this.contextProvider, modelType).CreateFields();
Beispiel #11
0
 public DetailFormLayout CreateFieldsCollection(IFormGroupSettings formSettings, Type modelType)
 => new ReadOnlyFieldsCollectionHelper(formSettings.FieldSettings, formSettings, this.contextProvider, modelType).CreateFields();