// TODO - substitute your own .esriTasks file
string taskFile = @"c:\Tasks\Get Started.esriTasks";
try
{
// retrieve the task item information
TaskItemInfo taskItemInfo = await TaskAssistantModule.GetTaskItemInfoAsync(taskFile);
string message = "Name : " + taskItemInfo.Name;
message += "\r\n" + "Description : " + taskItemInfo.Description;
message += "\r\n" + "Guid : " + taskItemInfo.Guid.ToString("B");
message += "\r\n" + "Task Count : " + taskItemInfo.GetTasks().Count();
ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(message, "Task Information");
}
catch (OpenTaskException e)
{
// exception thrown if task file doesn't exist or has incorrect format
ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(e.Message, "Task Information");
}
catch (TaskFileVersionException e)
{
// exception thrown if task file does not support returning task information
ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show(e.Message, "Task Information");
}