public Project(string name, DateTime beginDate, DateTime endDate, int? iterationLength, int? iterationGap) { Releases = new List<Project>(); Stories = new List<Story>(); Defects = new List<Defect>(); Epics = new List<Epic>(); Themes = new List<Theme>(); Iterations = new List<Iteration>(); Members = new List<Member>(); Environments = new List<Environment>(); //TestSets = new List<RegressionTestSet>(); RegressionPlans = new List<RegressionPlan>(); RegressionSuites = new List<RegressionSuite>(); RegressionTests = new List<RegressionTest>(); Goals = new List<Goal>(); Requests = new List<Request>(); Issues = new List<Issue>(); BuildProjects = new List<BuildProject>(); BuildRuns = new List<BuildRun>(); ChangeSets = new List<ChangeSet>(); Name = name; BeginDate = beginDate; EndDate = endDate; if (iterationLength != null && iterationGap != null) Schedule = new IterationSchedule((int)iterationLength, (int)iterationGap); }
public static Asset CreateSchedule(string name, IterationSchedule schedule) { IAssetType scheduleType = Program.MetaModel.GetAssetType("Schedule"); IAttributeDefinition scheduleName = scheduleType.GetAttributeDefinition("Name"); IAttributeDefinition scheduleLength = scheduleType.GetAttributeDefinition("TimeboxLength"); IAttributeDefinition scheduleGap = scheduleType.GetAttributeDefinition("TimeboxGap"); Asset newSchedule = Program.Services.New(scheduleType, null); newSchedule.SetAttributeValue(scheduleName, name + " Schedule"); newSchedule.SetAttributeValue(scheduleLength, schedule.Length); newSchedule.SetAttributeValue(scheduleGap, schedule.Gap); Program.Services.Save(newSchedule); return newSchedule; }