Skip to content

Roll your own taskmanager

Niklas Nihlen edited this page Dec 12, 2012 · 6 revisions

Do you want to create your own TaskManager that inserts tasks in a different backend (maybe Remember the Milk or something like that)? It's pretty easy.

Code

Either you fork this project and work in the CreateTask.TaskManagers project or you create a new class library and reference the CreateTask.Console project (ct.exe).

Then you just have to implement the interface ITaskManager:

public interface ITaskManager
{
void CreateTask(ITaskDTO taskData);
string FriendlyName { get; }
string CommandLinePattern { get; }
int Order { get; }
}

Implement the CreateTask method to talk to the system you like.

To get CreateTask to invoke your TaskManager you have a few options

  • Use the CommandLinePattern property and make it return the flag you want it to trigger on, such as "-trello" (Trello TaskManager)in my case or maybe "-rtm" for a service like remember the milk. The dash (-) has to be included in the property
  • Make it a default TaskManager (so you don't have to flag it) by setting the CommandLinePattern to return "*" (star) and either make sure there is no competing default TaskManagers or that the Order propertiy is a lower number on yours (my default OutlookTaskManager has Order = 100)

Deployment

Drop the dll into the same directory as ct.exe and run ct.exe --help. You should see your TaskManager listed in the usage dialog.

Clone this wiki locally