public ScheduleProcedureViewModel(ScheduleProcedure scheduleProcedure, Procedure callingProcedure = null)
		{
			CallingProcedure = callingProcedure;
			ScheduleProcedure = scheduleProcedure;
			Procedure = ClientManager.SystemConfiguration.AutomationConfiguration.Procedures.FirstOrDefault(x => x.Uid == scheduleProcedure.ProcedureUid);
			if (Procedure != null)
				UpdateArguments();
		}
		public override void UpdateContent()
		{
			ScheduleProcedures = new ObservableCollection<ScheduleProcedureViewModel>();
			foreach (var procedure in ClientManager.SystemConfiguration.AutomationConfiguration.Procedures.FindAll(x => x.Uid != Procedure.Uid))
			{
				var scheduleProcedure = new ScheduleProcedure { ProcedureUid = procedure.Uid };
				if (procedure.Uid == ProcedureSelectionStep.ScheduleProcedure.ProcedureUid)
					scheduleProcedure = ProcedureSelectionStep.ScheduleProcedure;
				ScheduleProcedures.Add(new ScheduleProcedureViewModel(scheduleProcedure, Procedure));
			}
			SelectedScheduleProcedure = ScheduleProcedures.FirstOrDefault(x => x.ScheduleProcedure.ProcedureUid == ProcedureSelectionStep.ScheduleProcedure.ProcedureUid);
			OnPropertyChanged(() => ScheduleProcedures);
		}
示例#3
0
		public ProcedureSelectionStep()
		{
			ScheduleProcedure = new ScheduleProcedure();
		}
示例#4
0
		void OnAdd()
		{
			var procedureSelectionViewModel = new ProcedureSelectionViewModel();
			if (DialogService.ShowModalWindow(procedureSelectionViewModel))
			{
				if (procedureSelectionViewModel.SelectedProcedure != null)
				{
					var scheduleProcedure = new ScheduleProcedure();
					scheduleProcedure.ProcedureUid = procedureSelectionViewModel.SelectedProcedure.Procedure.Uid;					
					var scheduleProcedureViewModel = new ScheduleProcedureViewModel(scheduleProcedure);
					ScheduleProcedures.Add(scheduleProcedureViewModel);
					Schedule.ScheduleProcedures.Add(scheduleProcedureViewModel.ScheduleProcedure);
					SelectedScheduleProcedure = scheduleProcedureViewModel;
					ServiceFactory.SaveService.AutomationChanged = true;
				}
			}
		}