예제 #1
0
 private void InitializeDialogProviders()
 {
     CrudDialogProvider.AddDialog <PresetViewModel>(_serviceProvider.GetService <INestedViewDialog <PresetViewModel> >());
     CrudDialogProvider.AddDialog <RegionViewModel>(_serviceProvider.GetService <INestedViewDialog <RegionViewModel> >());
     var messageBox    = new MessageBoxProvider(_serviceProvider.GetService <IDialogService <MessageBoxDialog, LulDialogResult> >());
     var inputProvider = new InputDialogProvider(_serviceProvider.GetService <IDialogService <InputDialog, InputDialogResult> >());
 }
예제 #2
0
        public static void InitializeInputDialog(string inputResult, DialogResults buttonResults)
        {
            InputDialogResult result = new InputDialogResult()
            {
                Input        = inputResult,
                DialogResult = buttonResults
            };

            var dialogService = Substitute.For <IDialogService <InputDialog, InputDialogResult> >();

            dialogService.Show(Arg.Any <string>(), Arg.Any <string>(), DialogButtons.OkCancel).Returns(result);

            var dialog = new InputDialogProvider(dialogService);
        }
예제 #3
0
        public void AddTriggerClicked(object args)
        {
            if (InputDialogProvider.Show("New Trigger", "New Trigger Name:", DialogButtons.OkCancel) is InputDialogResult dialogResult && dialogResult.DialogResult == DialogResults.Ok)
            {
                if (string.IsNullOrWhiteSpace(dialogResult.Input))
                {
                    return;
                }

                var newTrigger = _triggerController.CreateTrigger(SelectedPreset.Id, SelectedRegion.Id, dialogResult.Input);

                SelectedRegion.Triggers.Add(newTrigger);
                SelectedTrigger = newTrigger;
            }
        }