public void StartProject(BusinessProjectType projectType) { BusinessProjectMetadata projectData = potentialProjects.FirstOrDefault(pp => pp.BusinessProjectType == projectType); if (projectData == null) { throw new ArgumentOutOfRangeException(String.Format("No project registered with type {0}.", projectType)); } BusinessProject project = new BusinessProject(projectData.RequiredResearchLevel, projectData.BusinessProjectType); project.Started += (sender, e) => EventHelper.FireEvent(ProjectStarted, sender, e); project.Paused += (sender, e) => EventHelper.FireEvent(ProjectPaused, sender, e); project.Cancelled += (sender, e) => EventHelper.FireEvent(ProjectCancelled, sender, e); project.Completed += (sender, e) => EventHelper.FireEvent(ProjectCompleted, sender, e); project.Start(); projects.Add(project); }
public BusinessProjectMetadata(ResearchLevel requiredResearchLevel, BusinessProjectType businessProjectType) { RequiredResearchLevel = requiredResearchLevel; BusinessProjectType = businessProjectType; }
public BusinessProject(ResearchLevel requiredResearchLevel, BusinessProjectType businessProjectType) { RequiredResearchLevel = requiredResearchLevel; BusinessProjectType = businessProjectType; ID = Guid.NewGuid(); }