public void SetAllocatedToResources(IEnumerable <ResourceDto> targetResources, HashSet <int> allocatedToResources) { if (targetResources == null) { throw new ArgumentNullException(nameof(targetResources)); } if (allocatedToResources == null) { throw new ArgumentNullException(nameof(allocatedToResources)); } AllocatedToResources.SetAllocatedToResources(targetResources, allocatedToResources); UpdateAllocatedToResources(); }
public ManagedActivityViewModel( IDependentActivity <int> dependentActivity, DateTime projectStart, IEnumerable <ResourceDto> targetResources, IDateTimeCalculator dateTimeCalculator, IEventAggregator eventService) : this(dateTimeCalculator, eventService) { m_DependentActivity = dependentActivity ?? throw new ArgumentNullException(nameof(dependentActivity)); m_ProjectStart = projectStart; var selectedResources = new HashSet <int>(m_DependentActivity.TargetResources.ToList()); ResourceSelector.SetTargetResources(targetResources, selectedResources); AllocatedToResources.SetAllocatedToResources(targetResources, new HashSet <int>()); if (MinimumEarliestStartDateTime.HasValue) { CalculateMinimumEarliestStartTime(); } else if (MinimumEarliestStartTime.HasValue) { CalculateMinimumEarliestStartDateTime(); } }