Beispiel #1
0
        /// <summary>
        /// Loads the task with the specified GUID from the XML file or returns
        /// null if it does not exist.
        /// </summary>
        public MirrorTask LoadTask(string guid)
        {
            if (string.IsNullOrEmpty(guid))
            {
                return(null);
            }

            var element = GetTaskElement(guid);

            return(element == null ? null : MirrorTask.Deserialize(element));
        }
Beispiel #2
0
        /// <summary>Loads all tasks from the XML file.</summary>
        public List <MirrorTask> LoadTasks()
        {
            var tasks = new List <MirrorTask>();

            foreach (var element in RootElement.Elements("task"))
            {
                tasks.Add(MirrorTask.Deserialize(element));
            }

            return(tasks);
        }