/// <summary> /// Gibt für eine TaskComponentGroup das entsprechende ViewModel zurück. /// </summary> /// <param name="componentGroup">Die TaskComponentGroup.</param> /// <returns>Ein ViewModel des TaskComponentGroups.</returns> public static TaskComponentGroupViewModel Parse(TaskComponentGroup componentGroup) { var vm = new TaskComponentGroupViewModel { Id = componentGroup.Id, Name = componentGroup.Name }; foreach (var component in componentGroup.Components) { vm.TaskComponents.Add(TaskComponentViewModel.Parse(component)); } return vm; }
/// <summary> /// Parsed ein Schnittstellen-Modell in einen Task /// </summary> /// <param name="taskComponentGroupResponse">Das Modell der Schnittstelle.</param> /// <returns>Ein Task-Objekt.</returns> public static TaskComponentGroup Parse(TaskComponentGroupResponse taskComponentGroupResponse) { var taskComponentGroup = new TaskComponentGroup(taskComponentGroupResponse.Id, taskComponentGroupResponse.Name); foreach (var item in taskComponentGroupResponse.Components) { if (item == null) continue; var component = GetTaskComponent(item); component.FormGroup = taskComponentGroup; taskComponentGroup.Components.Add(component); } return taskComponentGroup; }
/// <summary> /// Zeigt die View zum Erstellen einer neuen Component an /// </summary> /// <param name="selectedGroup">Die zugehörige Gruppe des Components</param> public void showNewComponentView(TaskComponentGroup selectedGroup, ComponentType componentType) { if (componentType == ComponentType.TaskComponentText) { Content = new WorkflowContentEditorNewTextComponentViewModel(this, selectedGroup); } else if (componentType == ComponentType.TaskComponentInteger) { Content = new WorkflowContentEditorNewIntegerComponentViewModel(this, selectedGroup); } else if (componentType == ComponentType.TaskComponentFloat) { Content = new WorkflowContentEditorNewFloatComponentViewModel(this, selectedGroup); } else if (componentType == ComponentType.TaskComponentDate) { Content = new WorkflowContentEditorNewDateComponentViewModel(this, selectedGroup); } }
public WorkflowContentEditorNewIntegerComponentViewModel(WorkflowContentEditorBaseViewModel baseEditorViewModel, TaskComponentGroup selectedGroup) : base(baseEditorViewModel, selectedGroup) { }
public WorkflowContentEditorNewComponentViewModel(WorkflowContentEditorBaseViewModel baseEditorViewModel, TaskComponentGroup selectedGroup) { this.baseEditorViewModel = baseEditorViewModel; this.selectedGroup = selectedGroup; }
public WorkflowContentEditorViewModel(WorkflowContentEditorBaseViewModel baseEditorViewModel, WorkflowNavigationViewModel workflowNavigation, TaskComponentGroup selectedGroup) { this.WorkflowNavigation = workflowNavigation; this.baseEditorViewModel = baseEditorViewModel; // initialisiere Liste für Components der aktuellen Formgroup CurrentComponents = new ObservableCollection<TaskComponent>(); SelectedGroup = selectedGroup; LoadComponentGroups(); ClientSession.Instance.CurrentWorkflowChangedEvent += ClientSessionPropertyChanged; ClientSession.Instance.WorkflowChangedForContentEditorEvent += ClientSessionPropertyChanged; }
/// <summary> /// Zeigt die View zum erstellen einer neuen FormGroup an /// </summary> /// <param name="selectedGroup">Die zuvor ausgewählte Gruppe</param> public void showNewGroupListView(TaskComponentGroup selectedGroup) { Content = new WorkflowContentEditorNewGroupViewModel(this, selectedGroup); }
/// <summary> /// Zeigt die Liste der FormGroups mit zugehörigen Components an /// </summary> /// <param name="selectedGroup">Die zuvor ausgewählte Gruppe</param> public void showGroupListView(TaskComponentGroup selectedGroup) { Content = new WorkflowContentEditorViewModel(this, WorkflowNavigation, selectedGroup); }
public WorkflowContentEditorNewDateComponentViewModel(WorkflowContentEditorBaseViewModel baseEditorViewModel, TaskComponentGroup selectedGroup) : base(baseEditorViewModel, selectedGroup) { ComponentDefaultValue = DateTime.Today; }