private static void WriteTaskInfo(TaskInfo ti) { DocumentTask dt = apiClient.GetDocumentTask(ti.ID, DocumentTaskScope.Triggering); string startAt = ""; string hourly = "", daily = "", weekly = "", monthly = ""; foreach (Trigger t in dt.Triggering.Triggers) { try { startAt = ((RecurrenceTrigger)t).StartAt.ToString("HH:mm:ss"); hourly = ((RecurrenceTrigger)t).Hourly != null ? ((RecurrenceTrigger)t).Hourly.RecurEvery.ToString() : "N/A"; daily = ((RecurrenceTrigger)t).Daily != null ? ((RecurrenceTrigger)t).Daily.RecurEvery.ToString() : "N/A"; weekly = ((RecurrenceTrigger)t).Weekly != null ? ((RecurrenceTrigger)t).Weekly.RecurEvery.ToString() : "N/A"; //monthly = ((RecurrenceTrigger)t).Monthly.DayConstraints.ToString(); } catch (System.Exception) { } Console.WriteLine(ti.Name + "\t" + apiClient.GetTaskStatus(ti.ID, TaskStatusScope.All).General.Status.ToString() + "\t" + ti.Enabled.ToString() + "\t" + ti.ID.ToString() + "\t" + startAt + "\t" + hourly + "\t" + daily + "\t" + weekly); } }