public static bool AddNewTask(string description, DateTime requiredBy) { IList <TryItOut.Domain.Models.ToDoTask> toDoTasks = new List <TryItOut.Domain.Models.ToDoTask>(); bool status = false; XMLReadWrite wrtr = new XMLReadWrite(); try { /* controller helper should not do any working just calls and mappings */ /* ********************************************************* */ /* read existing XML file and add new task to existing tasks * write new task list to XML file */ /* ********************************************************* */ toDoTasks = wrtr.Read(); toDoTasks.Add(new TryItOut.Domain.Models.ToDoTask() { Identifier = toDoTasks.Max(i => i.Identifier) + 1, Description = description, RequiredBy = requiredBy }); wrtr.Write(toDoTasks); var tasks = wrtr.Read(); } catch { } return(status); }
public void Start() { Instance = this; DontDestroyOnLoad(this); }
public void Start() { Instance = this; DontDestroyOnLoad (this); }