Esempio n. 1
0
        public FieldsCollectionHelper(List <FormItemSettingsDescriptor> fieldSettings,
                                      IFormGroupBoxSettings groupBoxSettings,
                                      Dictionary <string, List <ValidationRuleDescriptor> > validationMessages,
                                      IContextProvider contextProvider,
                                      Type modelType,
                                      EditFormLayout formLayout = null,
                                      string parentName         = null)
        {
            this.fieldSettings         = fieldSettings;
            this.groupBoxSettings      = groupBoxSettings;
            this.validationMessages    = validationMessages;
            this.contextProvider       = contextProvider;
            this.modelType             = modelType;
            this.uiNotificationService = contextProvider.UiNotificationService;

            if (formLayout == null)
            {
                this.formLayout = new EditFormLayout();
                if (this.fieldSettings.ShouldCreateDefaultControlGroupBox())
                {
                    this.formLayout.AddControlGroupBox(this.groupBoxSettings);
                }
            }
            else
            {
                this.formLayout = formLayout;
            }

            this.parentName = parentName;
        }
 public Message(ScreenSettings <MessageTemplateView> screenSettings, UiNotificationService uiNitificationService, double transitionOffset)
 {
     this.InitializeComponent();
     this.TransitionOffset      = transitionOffset;
     this.screenSettings        = screenSettings;
     this.uiNitificationService = uiNitificationService;
 }
Esempio n. 3
0
 public FlowComplete(ScreenSettings <FlowCompleteView> screenSettings, UiNotificationService uiNotificationService, double transitionOffset)
 {
     this.InitializeComponent();
     this.screenSettings        = screenSettings;
     this.uiNotificationService = uiNotificationService;
     this.voiceInformation      = Helpers.GetVoice(this.uiNotificationService.SelectedVoice);
     this.uiNotificationService.ExitCalledFromMain.Subscribe(ExitCalled);
     this.TransitionOffset = transitionOffset;
     this.Loaded          += FlowComplete_Loaded;
 }
        async Task GoBack()
        {
            if (exited)//GoBack may be called by the voice AND a click event
            {
                return;
            }

            this.exited = true;
            media.StopMedia();
            await UiNotificationService.GoBack();
        }
Esempio n. 5
0
 public UiNotifierService(
     INotificationModelMapper <UiNotifierTemplate, UiNotificationMessage> notificationModelMapper,
     NotificationSettingsService notificationSettingsService,
     IIntranetUserService <IIntranetUser> intranetUserService,
     UiNotificationService notificationsService)
 {
     _notificationModelMapper     = notificationModelMapper;
     _notificationSettingsService = notificationSettingsService;
     _intranetUserService         = intranetUserService;
     _notificationsService        = notificationsService;
 }
Esempio n. 6
0
 public InputForm(ScreenSettings <InputFormView> screenSettings, UiNotificationService uiNitificationService, double transitionOffset)
 {
     this.InitializeComponent();
     this.TransitionOffset = transitionOffset;
     this.ScreenSettings   = screenSettings;
     Buttons = new ObservableCollection <CommandButtonView>(this.ScreenSettings.CommandButtons);
     this.RecognitionResults    = GetRecognitionResults(this.ScreenSettings.Settings.GetAllQuestions().First());
     this.UiNotificationService = uiNitificationService;
     this.voiceInformation      = Helpers.GetVoice(this.UiNotificationService.SelectedVoice);
     this.UiNotificationService.ExitCalledFromMain.Subscribe(ExitCalled);
     this.Loaded += InputForm_Loaded;
 }
Esempio n. 7
0
 public UiNotifierService(
     INotificationModelMapper <UiNotifierTemplate, UiNotificationMessage> notificationModelMapper,
     INotificationModelMapper <DesktopNotifierTemplate, DesktopNotificationMessage> desktopNotificationModelMapper,
     NotificationSettingsService notificationSettingsService,
     IIntranetMemberService <IIntranetMember> intranetMemberService,
     UiNotificationService notificationsService)
 {
     _notificationModelMapper        = notificationModelMapper;
     _notificationSettingsService    = notificationSettingsService;
     _intranetMemberService          = intranetMemberService;
     _notificationsService           = notificationsService;
     _desktopNotificationModelMapper = desktopNotificationModelMapper;
 }
 public SelectButton(ScreenSettings <MessageTemplateView> screenSettings, UiNotificationService uiNitificationService, double transitionOffset, ScrollViewer svDialog)
 {
     this.InitializeComponent();
     this.TransitionOffset = transitionOffset;
     this.svDialog         = svDialog;
     SetSelectedButton(screenSettings);
     this.ScreenSettings        = screenSettings;
     this.Buttons               = new ObservableCollection <CommandButtonView>(this.ScreenSettings.CommandButtons);
     this.RecognitionResults    = this.Buttons.ToDictionary(b => b.LongString);
     this.UiNotificationService = uiNitificationService;
     this.voiceInformation      = Helpers.GetVoice(this.UiNotificationService.SelectedVoice);
     this.UiNotificationService.ExitCalledFromMain.Subscribe(ExitCalled);
     this.Loaded += SelectButton_Loaded;
 }
        public Settings(UiNotificationService uiNotificationService)
        {
            this.InitializeComponent();

            if (ElementSoundPlayer.State == ElementSoundPlayerState.On)
            {
                soundToggle.IsOn = true;
            }
            if (ElementSoundPlayer.SpatialAudioMode == ElementSpatialAudioMode.On)
            {
                spatialSoundBox.IsChecked = true;
            }

            this.uiNotificationService = uiNotificationService;
            if (this.uiNotificationService.IsVoiceOn)
            {
                voiceToggle.IsOn = true;
            }

            this.SettingsViewModel = new SettingsViewModel(this.uiNotificationService);
            this.Loaded           += Settings_Loaded;
        }
Esempio n. 10
0
        private async Task DoNext(string shortText, bool cancel)
        {
            if (exited)//DoNext may be called by the voice AND a click event
            {
                return;
            }

            this.exited = true;
            media.StopMedia();

            await UiNotificationService.Next
            (
                new InputFormRequest
            {
                Form = ScreenSettings.Settings,
                CommandButtonRequest = new CommandButtonRequest {
                    NewSelection = shortText, Cancel = cancel
                },
                ViewType = ViewType.InputForm
            }
            );
        }
        private async Task DoNext(string shortText, string symptomText, bool addToSymptoms, bool cancel)
        {
            if (exited)//DoNext may be called by the voice AND a click event
            {
                return;
            }

            this.exited = true;
            media.StopMedia();

            await UiNotificationService.Next
            (
                new SelectRequest
            {
                AddToSymptoms        = addToSymptoms,
                MessageTemplateView  = GetMessageTemplateView(shortText, ScreenSettings.Settings),
                CommandButtonRequest = new CommandButtonRequest {
                    NewSelection = shortText, SymtomText = symptomText, Cancel = cancel
                },
                ViewType = ViewType.Select
            }
            );
        }
        public ContextProvider(UiNotificationService uiNotificationService,
                               IConditionalValidationConditionsBuilder conditionalValidationConditionsBuilder,
                               IEntityStateUpdater entityStateUpdater,
                               IEntityUpdater entityUpdater,
                               IGetItemFilterBuilder getItemFilterBuilder,
                               IHttpService httpService,
                               IMapper mapper,
                               ISearchSelectorBuilder searchSelectorBuilder,
                               IPropertiesUpdater propertiesUpdater,
                               IReadOnlyPropertiesUpdater readOnlyPropertiesUpdater,
                               IReadOnlyCollectionCellPropertiesUpdater readOnlyCollectionCellPropertiesUpdater,
                               IHideIfConditionalDirectiveBuilder hideIfConditionalDirectiveBuilder,
                               IClearIfConditionalDirectiveBuilder clearIfConditionalDirectiveBuilder,
                               IReloadIfConditionalDirectiveBuilder reloadIfConditionalDirectiveBuilder)
        {
            UiNotificationService = uiNotificationService;
            ConditionalValidationConditionsBuilder = conditionalValidationConditionsBuilder;
            EntityStateUpdater   = entityStateUpdater;
            EntityUpdater        = entityUpdater;
            GetItemFilterBuilder = getItemFilterBuilder;
            HttpService          = httpService;
            Mapper = mapper;
            SearchSelectorBuilder     = searchSelectorBuilder;
            PropertiesUpdater         = propertiesUpdater;
            ReadOnlyPropertiesUpdater = readOnlyPropertiesUpdater;
            ReadOnlyCollectionCellPropertiesUpdater = readOnlyCollectionCellPropertiesUpdater;
            HideIfConditionalDirectiveBuilder       = hideIfConditionalDirectiveBuilder;
            ClearIfConditionalDirectiveBuilder      = clearIfConditionalDirectiveBuilder;
            ReloadIfConditionalDirectiveBuilder     = reloadIfConditionalDirectiveBuilder;

            //passing IContextProvider to FieldsCollectionBuilder will create a circular dependency
            //so creating the instance here instead of using DI.
            FieldsCollectionBuilder           = new FieldsCollectionBuilder(this);
            UpdateOnlyFieldsCollectionBuilder = new UpdateOnlyFieldsCollectionBuilder(this);
            ReadOnlyFieldsCollectionBuilder   = new ReadOnlyFieldsCollectionBuilder(this);
            CollectionCellItemsBuilder        = new CollectionCellItemsBuilder(this);
        }
 public EditFormEntityViewModel(ScreenSettings <EditFormSettingsDescriptor> screenSettings, UiNotificationService uiNotificationService, IMapper mapper, IHttpService httpService)
     : base(screenSettings, uiNotificationService, httpService, mapper)
 {
     this.validateIfManager = new ValidateIfManager <TModel>
                              (
         Properties,
         fieldsCollectionHelper.GetConditionalValidationConditions <TModel>
         (
             FormSettings.ConditionalDirectives,
             Properties,
             mapper
         ),
         mapper,
         this.UiNotificationService
                              );
 }
 public SwitchValidatableObject(string name, string templateName, string switchLabel, IEnumerable <IValidationRule> validations, UiNotificationService uiNotificationService)
     : base(name, templateName, validations, uiNotificationService)
 {
     SwitchLabel = switchLabel;
 }
 public HideIfManager(IEnumerable <IFormField> currentProperties, List <HideIf <TModel> > conditions, IMapper mapper, UiNotificationService uiNotificationService)
 {
     CurrentProperties           = currentProperties;
     this.conditions             = conditions;
     this.mapper                 = mapper;
     this.uiNotificationService  = uiNotificationService;
     propertyChangedSubscription = this.uiNotificationService.ValueChanged.Subscribe(PropertyChanged);
 }
Esempio n. 16
0
 public EntryValidatableObject(string name, string templateName, string placeholder, string stringFormat, IEnumerable <IValidationRule> validations, UiNotificationService uiNotificationService)
     : base(name, templateName, validations, uiNotificationService)
 {
     Placeholder  = placeholder;
     StringFormat = stringFormat;
 }
Esempio n. 17
0
 public FormArrayValidatableObject(string name, FormGroupArraySettingsDescriptor setting, IEnumerable <IValidationRule> validations, UiNotificationService uiNotificationService)
     : base(name, setting.FormGroupTemplate.TemplateName, validations, uiNotificationService)
 {
 }
 public SettingsViewModel(UiNotificationService uiNotificationService)
 {
     this.uiNotificationService = uiNotificationService;
     this.Voices = new ObservableCollection <VoiceModel>(Helpers.SupportedVoices);
 }
Esempio n. 19
0
 public ScopedFlowManagerService(IServiceScopeFactory serviceScopeFactory, IAppLogger appLogger, UiNotificationService uiNotificationService)
 {
     this.appLogger             = appLogger;
     this.uiNotificationService = uiNotificationService;
     scope       = serviceScopeFactory.CreateScope();
     FlowManager = scope.ServiceProvider.GetRequiredService <IFlowManager>();
 }
 public EntryValidatableObject(string name, FormControlSettingsDescriptor setting, IEnumerable <IValidationRule> validations, UiNotificationService uiNotificationService)
     : base(name, setting.TextTemplate.TemplateName, validations, uiNotificationService)
 {
     Placeholder = setting.Placeholder;
 }
Esempio n. 21
0
 protected ReadOnlyObjectBase(string name, string templateName, UiNotificationService uiNotificationService)
 {
     Name         = name;
     TemplateName = templateName;
     this.uiNotificationService = uiNotificationService;
 }
Esempio n. 22
0
 public ValidateIfManager(ICollection <IValidatable> currentProperties, List <ValidateIf <TModel> > conditions, IMapper mapper, UiNotificationService uiNotificationService)
 {
     CurrentProperties           = currentProperties;
     this.conditions             = conditions;
     this.mapper                 = mapper;
     this.uiNotificationService  = uiNotificationService;
     propertyChangedSubscription = this.uiNotificationService.ValueChanged.Subscribe(PropertyChanged);
 }
Esempio n. 23
0
 public ValidatableObjectBase(string name, string templateName, IEnumerable <IValidationRule> validations, UiNotificationService uiNotificationService)
 {
     Name         = name;
     TemplateName = templateName;
     Validations  = validations?.ToList();
     this.uiNotificationService = uiNotificationService;
 }
 protected EditFormEntityViewModelBase(ScreenSettings <EditFormSettingsDescriptor> screenSettings, UiNotificationService uiNotificationService, IHttpService httpService, IMapper mapper)
 {
     this.UiNotificationService = uiNotificationService;
     FormSettings           = screenSettings.Settings;
     Buttons                = new ObservableCollection <CommandButtonDescriptor>(screenSettings.CommandButtons);
     fieldsCollectionHelper = new FieldsCollectionHelper(this.FormSettings, Properties, this.UiNotificationService, httpService, mapper);
     fieldsCollectionHelper.CreateFieldsCollection();
     propertyChangedSubscription = this.UiNotificationService.ValueChanged.Subscribe(FieldChanged);
 }
Esempio n. 25
0
 public LabelValidatableObject(string name, string templateName, string title, string placeholder, string stringFormat, IEnumerable <IValidationRule> validations, UiNotificationService uiNotificationService)
     : base(name, templateName, validations, uiNotificationService)
 {
     Placeholder       = placeholder;
     Title             = title;
     this.stringFormat = stringFormat;
 }
 public PickerValidatableObject(string name, FormControlSettingsDescriptor setting, IHttpService httpService, IEnumerable <IValidationRule> validations, UiNotificationService uiNotificationService)
     : base(name, setting.DropDownTemplate.TemplateName, validations, uiNotificationService)
 {
     this.Title             = setting.Title;
     this._dropDownTemplate = setting.DropDownTemplate;
     this.httpService       = httpService;
     GetItemSource();
 }
 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;
 }
 public CheckboxValidatableObject(string name, string templateName, string checkboxLabel, IEnumerable <IValidationRule> validations, UiNotificationService uiNotificationService)
     : base(name, templateName, validations, uiNotificationService)
 {
     CheckboxLabel = checkboxLabel;
 }
 public TextPageViewModel(UiNotificationService uiNotificationService)
 {
     this.uiNotificationService = uiNotificationService;
 }
Esempio n. 30
0
 public MultiSelectValidatableObject(string name, MultiSelectFormControlSettingsDescriptor setting, IHttpService httpService, IEnumerable <IValidationRule> validations, UiNotificationService uiNotificationService)
     : base(name, setting.MultiSelectTemplate.TemplateName, validations, uiNotificationService)
 {
     this.Title = setting.Title;
     this._multiSelectFormControlSettingsDescriptor = setting;
     this._multiSelectTemplate = setting.MultiSelectTemplate;
     this.httpService          = httpService;
     itemComparer  = new MultiSelectItemComparer <E>(_multiSelectFormControlSettingsDescriptor.KeyFields);
     SelectedItems = new ObservableCollection <object>();
     GetItemSource();
 }