Esempio n. 1
0
 public override void Apply(MazeTask mazeTask)
 {
     mazeTask.Triggers = new List <TriggerInfo>();
     foreach (var taskView in _childs)
     {
         var dto = TaskServiceViewModelUtils.Build <TriggerInfo>(taskView.ViewModel);
         mazeTask.Triggers.Add(dto);
     }
 }
Esempio n. 2
0
        public override void Initialize(MazeTask mazeTask)
        {
            foreach (var triggerInfo in mazeTask.Triggers)
            {
                var triggerInfoType = triggerInfo.GetType();
                var description     = AvailableServices.First(x => x.DtoType == triggerInfoType);
                var view            = CreateView(description);

                TaskServiceViewModelUtils.Initialize(view.ViewModel, triggerInfo);
                AddChild(view);

                if (mazeTask.Triggers.Count == 1)
                {
                    SetProperty(ref _selectedService, description, nameof(SelectedService));
                    SetProperty(ref _selectedChild, view, nameof(SelectedChild));
                }
            }
        }