Classes in ToDoListLib
The following classes have been created for ToDoListLib. Following these are classes which get generated by the XSD utility from schema.
Represents the entire .tdl file, a single task list and all tasks. This is a wrapper which encapsulates the TODOLIST class generated from schema.
The easiest way to generate an object of this type from an existing .tdl file is:
var safeList = SafeTaskList.Return(PATH);
See the TestTdlLib1 console app where the Program.cs file shows several ways to instantiate a SafeTaskList.
A task list has a property Tasks of type List<SafeTask>. See similar property below.
All values defined from the schema are represented by get/set properties. Some helper methods are also provided to facilitate modification of collections. For example: AddPerson() and RemoveTag().
See the SafeTaskList page for more details.
Represents a single task and nested tasks. This is a wrapper which encapsulates the TASK class generated from schema.
To get a new SafeTask, use one of the following approaches:
- var task = new SafeTask(safeList); // gets a new task with valid next-ID from existing list
- var task = safeList.GetNewTask(); // alternate syntax on list object
List the SafeTaskList, a task has a property Tasks of type List<SafeTask>. This structure facilitates nested levels of tasks and parent/child relationships.
The Tasks property allows manipulation of the collection as a whole.
All values defined from the schema are represented by get/set properties. Some helper methods are also provided to facilitate modification of collections. For example: AddCategory() and RemoveAllocatedTo().
See the SafeTask page for more details.
For Custom Attributes
See CustomAttributes page.
For Recurring Tasks
See TaskRecurrence page.
The Helpers class has common extensions and other static methods to help maintain consistency in processing fields.
Supporting structs and enums
Enum allows precision assignment of the type of comments attached to a task, Plain or RichText.
Allows for developer-assigned meta data to be attached to tasks. Currently the only value defined is a Boolean called Selected.
Enum with constants defined in TDL for units of time for time spent and estimates. When a unit has not been defined use value TimeUnit.Unspecified. Other values include H for hours, Y for years, and "i" for mInutes since M is used for Months. (That's
the way it is in the TDL code and XML. This library just facilitates ensuring that the right value are set.)
This new exception was created to warn developers that they're passing in an invalid value. But ApplicationException and others have been used in preference to a custom Exception. This will be removed from the library soon.
Generated Classes and supporting files
The Schema folder in the ToDoListLib project has the TdlSchema.xml file, generated with xsd.exe from the TdlSchema.tdl file.
It contains the TdlSchema.xsd file, also generated by xsd.exe. This file is seen in Visual Studio as a parent/container file for TdlSchema.cs, generated by xsd.exe. This C# file contains the classes TODOLIST, TASK, and others that are encapsulated in this
library. The other files under the xsd are generated by Visual Studio and not pertinent to library development or usage.