コード例 #1
0
ファイル: TasksFactory.cs プロジェクト: oliver-spryn/College
        private void addToSprint(string sprintData, TaskModel tm)
        {
            string name = sprintData == null ? "Unassigned" : getSprintName(sprintData);

            //A new sprint may need to be created
            if (sprintData == null && !Sprints.ContainsKey(name)) {
                Sprints[name] = new SprintModel();
                Sprints[name].CompleteDate = Epoch;
                Sprints[name].EndDate = Epoch;
                Sprints[name].Name = name;
                Sprints[name].StartDate = Epoch;
                Sprints[name].State = "FUTURE";
                Sprints[name].Tasks = new List<TaskModel>();
            } else if (!Sprints.ContainsKey(name)) {
                Sprints[name] = createSprint(sprintData);
            }

            Sprints[name].Tasks.Add(tm);
        }
コード例 #2
0
ファイル: TasksFactory.cs プロジェクト: oliver-spryn/College
        private SprintModel createSprint(string sprintData)
        {
            SprintModel sm = new SprintModel();

            //This is a comma delimited list
            string[] parts = sprintData.Split(',');
            string[] small;

            //Completion date
            small = parts[5].Split('=');

            if (small[1] == "<null>") {
                sm.CompleteDate = Epoch;
            } else {
                sm.CompleteDate = DateTime.Parse(small[1]);
            }

            //End date
            small = parts[4].Split('=');

            if (small[1] == "<null>") {
                sm.EndDate = Epoch;
            } else {
                sm.EndDate = DateTime.Parse(small[1]);
            }

            //Name
            small = parts[2].Split('=');
            sm.Name = small[1];

            //Start date
            small = parts[3].Split('=');

            if (small[1] == "<null>") {
                sm.StartDate = Epoch;
            } else {
                sm.StartDate = DateTime.Parse(small[1]);
            }

            //State
            small = parts[1].Split('=');
            sm.State = small[1];

            //Tasks
            sm.Tasks = new List<TaskModel>();

            return sm;
        }