This project has moved and is read-only. For the latest updates, please go here.

Access to Trigger description

Mar 23, 2011 at 2:58 PM

Is there a way to get the trigger description text as displayed by the Task Scheduler?  E.g., Run "At 1:31 PM every 2 days - After triggered, repeat every 00:10:00 indefinitely."

Mar 23, 2011 at 5:38 PM


Mar 23, 2011 at 6:31 PM

As smvdh noted, the Trigger.ToString() method will do that. Since the library is using a resource file for all that text, you can also support localization by supplying your own translated resources asssemblies. Assuming your task is registered and there is only one trigger, the code would look something like the following:

TaskService ts = new TaskService();
string descText = ts.GetTask("MyTaskName").Definition.Triggers[0].ToString();