コード例 #1
0
        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);
        }
コード例 #2
0
 public BusinessProjectMetadata(ResearchLevel requiredResearchLevel, BusinessProjectType businessProjectType)
 {
     RequiredResearchLevel = requiredResearchLevel;
     BusinessProjectType   = businessProjectType;
 }
コード例 #3
0
 public BusinessProject(ResearchLevel requiredResearchLevel, BusinessProjectType businessProjectType)
 {
     RequiredResearchLevel = requiredResearchLevel;
     BusinessProjectType   = businessProjectType;
     ID = Guid.NewGuid();
 }