private IEnumerable <OpalisTaskTrigger> AddTrigger() { ScheduledTasks st = new ScheduledTasks(@"\\" + computerName); Task t = st.OpenTask(taskName); t.SetAccountInformation(accountName, password); RunOnceTrigger trigger = new RunOnceTrigger(Convert.ToDateTime(dateTime)); t.Triggers.Add(trigger); t.Save(); String Type = trigger.GetType().ToString().Split('.')[1]; String BeginDay = trigger.taskTrigger.BeginDay.ToString(); String BeginMonth = trigger.taskTrigger.BeginMonth.ToString(); String BeginYear = trigger.taskTrigger.BeginYear.ToString(); String EndDay = trigger.taskTrigger.EndDay.ToString(); String EndMonth = trigger.taskTrigger.EndMonth.ToString(); String EndYear = trigger.taskTrigger.EndYear.ToString(); String flags = trigger.taskTrigger.Flags.ToString(); String MinutesDuration = trigger.taskTrigger.MinutesDuration.ToString(); String MinutesInterval = trigger.taskTrigger.MinutesInterval.ToString(); String RandomMinutesInterval = trigger.taskTrigger.RandomMinutesInterval.ToString(); String StartHour = trigger.taskTrigger.StartHour.ToString(); String StartMinute = trigger.taskTrigger.StartMinute.ToString(); String TriggerSize = trigger.taskTrigger.TriggerSize.ToString(); String Bound = trigger.Bound.ToString(); String Disabled = trigger.Disabled.ToString(); String HasEndDate = trigger.HasEndDate.ToString(); String KillAtDurationEnd = trigger.KillAtDurationEnd.ToString(); String DaysInterval = trigger.taskTrigger.Data.daily.DaysInterval.ToString(); String MonthlyDateDays = trigger.taskTrigger.Data.monthlyDate.Days.ToString(); String MonthlyDateMonths = trigger.taskTrigger.Data.monthlyDate.Months.ToString(); String MonthlyDOWDaysOfTheWeek = trigger.taskTrigger.Data.monthlyDOW.DaysOfTheWeek.ToString(); String MonthlyDOWMonths = trigger.taskTrigger.Data.monthlyDOW.Months.ToString(); String MonthlyDOWWhichWeek = trigger.taskTrigger.Data.monthlyDOW.WhichWeek.ToString(); String weeklyDaysOfTheWeek = trigger.taskTrigger.Data.weekly.DaysOfTheWeek.ToString(); String weeklyWeeksInterval = trigger.taskTrigger.Data.weekly.WeeksInterval.ToString(); String DisplayString = trigger.ToString(); yield return(new OpalisTaskTrigger(Type, BeginDay, BeginMonth, BeginYear, EndDay, EndMonth, EndYear, flags, MinutesDuration, MinutesInterval, RandomMinutesInterval, StartHour, StartMinute, TriggerSize, Bound, Disabled, HasEndDate, KillAtDurationEnd, DaysInterval, MonthlyDateDays, MonthlyDateMonths, MonthlyDOWDaysOfTheWeek, MonthlyDOWMonths, MonthlyDOWWhichWeek, weeklyDaysOfTheWeek, weeklyWeeksInterval, DisplayString)); t.Close(); st.Dispose(); }
private IEnumerable <opalisTask> deleteTask() { ScheduledTasks st = new ScheduledTasks(@"\\" + computerName); Task t = st.OpenTask(taskName); String AccountName = t.AccountName.ToString(); String ApplicationName = t.ApplicationName.ToString(); String Comment = t.Comment.ToString(); String Creator = t.Creator.ToString(); String ExitCode = t.ExitCode.ToString(); String Flags = t.Flags.ToString(); String Hidden = t.Hidden.ToString(); String IdleWaitDeadlineMinutes = t.IdleWaitDeadlineMinutes.ToString(); String IdleWaitMinutes = t.IdleWaitMinutes.ToString(); String MaxRunTime = t.MaxRunTime.ToString(); String MaxRunTimeLimited = t.MaxRunTimeLimited.ToString(); String MostRecentRunTime = t.MostRecentRunTime.ToString(); String Name = t.Name.ToString(); String NextRunTime = t.NextRunTime.ToString(); String Parameters = t.Parameters.ToString(); String Priority = t.Priority.ToString(); String Status = t.Status.ToString(); String WorkingDirectory = t.WorkingDirectory.ToString(); numTasks++; t.Close(); st.DeleteTask(taskName); yield return(new opalisTask(Name, AccountName, ApplicationName, Comment, Creator, ExitCode, Flags, Hidden, IdleWaitDeadlineMinutes, IdleWaitMinutes, MaxRunTime, MaxRunTimeLimited, MostRecentRunTime, NextRunTime, Parameters, Priority, Status, WorkingDirectory)); st.Dispose(); }
public void Execute(IActivityRequest request, IActivityResponse response) { computerName = request.Inputs["Computer Name"].AsString(); taskName = request.Inputs["Task Name"].AsString(); ScheduledTasks st = new ScheduledTasks(@"\\" + computerName); Task t = st.OpenTask(taskName); t.Run(); taskStatus = t.Status.ToString(); t.Close(); while (taskStatus.Equals("Ready")) { t = st.OpenTask(taskName); taskStatus = t.Status.ToString(); t.Close(); } st.Dispose(); response.Publish("Task Status", taskStatus); }
private IEnumerable <OpalisTaskTrigger> AddTrigger() { ScheduledTasks st = new ScheduledTasks(@"\\" + computerName); Task t = st.OpenTask(taskName); MonthlyDOWTrigger trigger = new MonthlyDOWTrigger(0, 0, DaysOfTheWeek.Sunday, WhichWeek.FirstWeek); switch (dayOfTheWeek) { case "Monday": switch (week) { case "FirstWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Monday, WhichWeek.FirstWeek); break; case "FourthWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Monday, WhichWeek.FourthWeek); break; case "LastWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Monday, WhichWeek.LastWeek); break; case "SecondWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Monday, WhichWeek.SecondWeek); break; case "ThirdWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Monday, WhichWeek.ThirdWeek); break; } break; case "Tuesday": switch (week) { case "FirstWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Tuesday, WhichWeek.FirstWeek); break; case "FourthWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Tuesday, WhichWeek.FourthWeek); break; case "LastWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Tuesday, WhichWeek.LastWeek); break; case "SecondWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Tuesday, WhichWeek.SecondWeek); break; case "ThirdWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Tuesday, WhichWeek.ThirdWeek); break; } break; case "Wednesday": switch (week) { case "FirstWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Wednesday, WhichWeek.FirstWeek); break; case "FourthWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Wednesday, WhichWeek.FourthWeek); break; case "LastWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Wednesday, WhichWeek.LastWeek); break; case "SecondWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Wednesday, WhichWeek.SecondWeek); break; case "ThirdWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Wednesday, WhichWeek.ThirdWeek); break; } break; case "Thursday": switch (week) { case "FirstWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Thursday, WhichWeek.FirstWeek); break; case "FourthWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Thursday, WhichWeek.FourthWeek); break; case "LastWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Thursday, WhichWeek.LastWeek); break; case "SecondWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Thursday, WhichWeek.SecondWeek); break; case "ThirdWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Thursday, WhichWeek.ThirdWeek); break; } break; case "Friday": switch (week) { case "FirstWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Friday, WhichWeek.FirstWeek); break; case "FourthWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Friday, WhichWeek.FourthWeek); break; case "LastWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Friday, WhichWeek.LastWeek); break; case "SecondWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Friday, WhichWeek.SecondWeek); break; case "ThirdWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Friday, WhichWeek.ThirdWeek); break; } break; case "Saturday": switch (week) { case "FirstWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Saturday, WhichWeek.FirstWeek); break; case "FourthWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Saturday, WhichWeek.FourthWeek); break; case "LastWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Saturday, WhichWeek.LastWeek); break; case "SecondWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Saturday, WhichWeek.SecondWeek); break; case "ThirdWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Saturday, WhichWeek.ThirdWeek); break; } break; case "Sunday": switch (week) { case "FirstWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Sunday, WhichWeek.FirstWeek); break; case "FourthWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Sunday, WhichWeek.FourthWeek); break; case "LastWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Sunday, WhichWeek.LastWeek); break; case "SecondWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Sunday, WhichWeek.SecondWeek); break; case "ThirdWeek": trigger = new MonthlyDOWTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), DaysOfTheWeek.Sunday, WhichWeek.ThirdWeek); break; } break; } t.Triggers.Add(trigger); t.Save(); String Type = trigger.GetType().ToString().Split('.')[1]; String BeginDay = trigger.taskTrigger.BeginDay.ToString(); String BeginMonth = trigger.taskTrigger.BeginMonth.ToString(); String BeginYear = trigger.taskTrigger.BeginYear.ToString(); String EndDay = trigger.taskTrigger.EndDay.ToString(); String EndMonth = trigger.taskTrigger.EndMonth.ToString(); String EndYear = trigger.taskTrigger.EndYear.ToString(); String flags = trigger.taskTrigger.Flags.ToString(); String MinutesDuration = trigger.taskTrigger.MinutesDuration.ToString(); String MinutesInterval = trigger.taskTrigger.MinutesInterval.ToString(); String RandomMinutesInterval = trigger.taskTrigger.RandomMinutesInterval.ToString(); String StartHour = trigger.taskTrigger.StartHour.ToString(); String StartMinute = trigger.taskTrigger.StartMinute.ToString(); String TriggerSize = trigger.taskTrigger.TriggerSize.ToString(); String Bound = trigger.Bound.ToString(); String Disabled = trigger.Disabled.ToString(); String HasEndDate = trigger.HasEndDate.ToString(); String KillAtDurationEnd = trigger.KillAtDurationEnd.ToString(); String DaysInterval = trigger.taskTrigger.Data.daily.DaysInterval.ToString(); String MonthlyDateDays = trigger.taskTrigger.Data.monthlyDate.Days.ToString(); String MonthlyDateMonths = trigger.taskTrigger.Data.monthlyDate.Months.ToString(); String MonthlyDOWDaysOfTheWeek = trigger.taskTrigger.Data.monthlyDOW.DaysOfTheWeek.ToString(); String MonthlyDOWMonths = trigger.taskTrigger.Data.monthlyDOW.Months.ToString(); String MonthlyDOWWhichWeek = trigger.taskTrigger.Data.monthlyDOW.WhichWeek.ToString(); String weeklyDaysOfTheWeek = trigger.taskTrigger.Data.weekly.DaysOfTheWeek.ToString(); String weeklyWeeksInterval = trigger.taskTrigger.Data.weekly.WeeksInterval.ToString(); String DisplayString = trigger.ToString(); yield return(new OpalisTaskTrigger(Type, BeginDay, BeginMonth, BeginYear, EndDay, EndMonth, EndYear, flags, MinutesDuration, MinutesInterval, RandomMinutesInterval, StartHour, StartMinute, TriggerSize, Bound, Disabled, HasEndDate, KillAtDurationEnd, DaysInterval, MonthlyDateDays, MonthlyDateMonths, MonthlyDOWDaysOfTheWeek, MonthlyDOWMonths, MonthlyDOWWhichWeek, weeklyDaysOfTheWeek, weeklyWeeksInterval, DisplayString)); t.Close(); st.Dispose(); }
private IEnumerable <OpalisTaskTrigger> AddTrigger() { ScheduledTasks st = new ScheduledTasks(@"\\" + computerName); Task t = st.OpenTask(taskName); string[] dayStringArray = dayList.Split(','); int[] dayArray = new int[dayStringArray.Length]; for (int i = 0; i < dayArray.Length; i++) { dayArray[i] = Convert.ToInt16(dayStringArray[i]); } MonthlyTrigger trigger = new MonthlyTrigger(0, 0, dayArray); switch (month) { case "January": trigger = new MonthlyTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), dayArray, MonthsOfTheYear.January); break; case "Febuary": trigger = new MonthlyTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), dayArray, MonthsOfTheYear.February); break; case "March": trigger = new MonthlyTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), dayArray, MonthsOfTheYear.March); break; case "April": trigger = new MonthlyTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), dayArray, MonthsOfTheYear.April); break; case "May": trigger = new MonthlyTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), dayArray, MonthsOfTheYear.May); break; case "June": trigger = new MonthlyTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), dayArray, MonthsOfTheYear.June); break; case "July": trigger = new MonthlyTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), dayArray, MonthsOfTheYear.July); break; case "August": trigger = new MonthlyTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), dayArray, MonthsOfTheYear.August); break; case "September": trigger = new MonthlyTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), dayArray, MonthsOfTheYear.September); break; case "October": trigger = new MonthlyTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), dayArray, MonthsOfTheYear.October); break; case "November": trigger = new MonthlyTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), dayArray, MonthsOfTheYear.November); break; case "December": trigger = new MonthlyTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), dayArray, MonthsOfTheYear.December); break; default: trigger = new MonthlyTrigger(Convert.ToInt16(hour), Convert.ToInt16(minute), dayArray, MonthsOfTheYear.August); break; } t.Triggers.Add(trigger); t.Save(); String Type = trigger.GetType().ToString().Split('.')[1]; String BeginDay = trigger.taskTrigger.BeginDay.ToString(); String BeginMonth = trigger.taskTrigger.BeginMonth.ToString(); String BeginYear = trigger.taskTrigger.BeginYear.ToString(); String EndDay = trigger.taskTrigger.EndDay.ToString(); String EndMonth = trigger.taskTrigger.EndMonth.ToString(); String EndYear = trigger.taskTrigger.EndYear.ToString(); String flags = trigger.taskTrigger.Flags.ToString(); String MinutesDuration = trigger.taskTrigger.MinutesDuration.ToString(); String MinutesInterval = trigger.taskTrigger.MinutesInterval.ToString(); String RandomMinutesInterval = trigger.taskTrigger.RandomMinutesInterval.ToString(); String StartHour = trigger.taskTrigger.StartHour.ToString(); String StartMinute = trigger.taskTrigger.StartMinute.ToString(); String TriggerSize = trigger.taskTrigger.TriggerSize.ToString(); String Bound = trigger.Bound.ToString(); String Disabled = trigger.Disabled.ToString(); String HasEndDate = trigger.HasEndDate.ToString(); String KillAtDurationEnd = trigger.KillAtDurationEnd.ToString(); String DaysInterval = trigger.taskTrigger.Data.daily.DaysInterval.ToString(); String MonthlyDateDays = trigger.taskTrigger.Data.monthlyDate.Days.ToString(); String MonthlyDateMonths = trigger.taskTrigger.Data.monthlyDate.Months.ToString(); String MonthlyDOWDaysOfTheWeek = trigger.taskTrigger.Data.monthlyDOW.DaysOfTheWeek.ToString(); String MonthlyDOWMonths = trigger.taskTrigger.Data.monthlyDOW.Months.ToString(); String MonthlyDOWWhichWeek = trigger.taskTrigger.Data.monthlyDOW.WhichWeek.ToString(); String weeklyDaysOfTheWeek = trigger.taskTrigger.Data.weekly.DaysOfTheWeek.ToString(); String weeklyWeeksInterval = trigger.taskTrigger.Data.weekly.WeeksInterval.ToString(); String DisplayString = trigger.ToString(); yield return(new OpalisTaskTrigger(Type, BeginDay, BeginMonth, BeginYear, EndDay, EndMonth, EndYear, flags, MinutesDuration, MinutesInterval, RandomMinutesInterval, StartHour, StartMinute, TriggerSize, Bound, Disabled, HasEndDate, KillAtDurationEnd, DaysInterval, MonthlyDateDays, MonthlyDateMonths, MonthlyDOWDaysOfTheWeek, MonthlyDOWMonths, MonthlyDOWWhichWeek, weeklyDaysOfTheWeek, weeklyWeeksInterval, DisplayString)); t.Close(); st.Dispose(); }
private IEnumerable <opalisTask> SetScheduledTasks() { ScheduledTasks st = new ScheduledTasks(@"\\" + computerName); Task t = st.OpenTask(taskName); if (!(applicationName.Equals(String.Empty))) { t.ApplicationName = applicationName; } if (!(parameters.Equals(String.Empty))) { t.Parameters = parameters; } if (!(comment.Equals(String.Empty))) { t.Comment = comment; } if (!(creator.Equals(String.Empty))) { t.Creator = creator; } if (!(workingDirectory.Equals(String.Empty))) { t.WorkingDirectory = workingDirectory; } if (!((accountName.Equals(String.Empty)) & (password.Equals(string.Empty)))) { t.SetAccountInformation(accountName, password); } if (!(idleWaitDeadlineMinutes.Equals(String.Empty))) { t.IdleWaitDeadlineMinutes = Convert.ToInt16(idleWaitDeadlineMinutes); } if (!(idleWaitMinutes.Equals(String.Empty))) { t.IdleWaitMinutes = Convert.ToInt16(idleWaitMinutes); } if ((hidden.Equals("True"))) { t.Hidden = true; } if (!(maxRuntime.Equals(String.Empty))) { t.MaxRunTime = new TimeSpan(0, 0, Convert.ToInt32(maxRuntime)); } if (!(priority.Equals(String.Empty))) { switch (priority) { case "AboveNormal": t.Priority = System.Diagnostics.ProcessPriorityClass.AboveNormal; break; case "BelowNormal": t.Priority = System.Diagnostics.ProcessPriorityClass.BelowNormal; break; case "High": t.Priority = System.Diagnostics.ProcessPriorityClass.High; break; case "Idle": t.Priority = System.Diagnostics.ProcessPriorityClass.Idle; break; case "Normal": t.Priority = System.Diagnostics.ProcessPriorityClass.Normal; break; case "RealTime": t.Priority = System.Diagnostics.ProcessPriorityClass.RealTime; break; } } t.Save(); t.Close(); t = st.OpenTask(taskName); String AccountName = t.AccountName.ToString(); String ApplicationName = t.ApplicationName.ToString(); String Comment = t.Comment.ToString(); String Creator = t.Creator.ToString(); String ExitCode = t.ExitCode.ToString(); String Flags = t.Flags.ToString(); String Hidden = t.Hidden.ToString(); String IdleWaitDeadlineMinutes = t.IdleWaitDeadlineMinutes.ToString(); String IdleWaitMinutes = t.IdleWaitMinutes.ToString(); String MaxRunTime = t.MaxRunTime.ToString(); String MaxRunTimeLimited = t.MaxRunTimeLimited.ToString(); String MostRecentRunTime = t.MostRecentRunTime.ToString(); String Name = t.Name.ToString(); String NextRunTime = t.NextRunTime.ToString(); String Parameters = t.Parameters.ToString(); String Priority = t.Priority.ToString(); String Status = t.Status.ToString(); String WorkingDirectory = t.WorkingDirectory.ToString(); t.Close(); yield return(new opalisTask(Name, AccountName, ApplicationName, Comment, Creator, ExitCode, Flags, Hidden, IdleWaitDeadlineMinutes, IdleWaitMinutes, MaxRunTime, MaxRunTimeLimited, MostRecentRunTime, NextRunTime, Parameters, Priority, Status, WorkingDirectory)); st.Dispose(); }
private IEnumerable <opalisTask> getScheduledTasks() { ScheduledTasks st = new ScheduledTasks(@"\\" + computerName); if (taskName.Equals(String.Empty)) { string[] taskNames = st.GetTaskNames(); foreach (string tName in taskNames) { Task t = st.OpenTask(tName); String AccountName = t.AccountName.ToString(); String ApplicationName = t.ApplicationName.ToString(); String Comment = t.Comment.ToString(); String Creator = t.Creator.ToString(); String ExitCode = t.ExitCode.ToString(); String Flags = t.Flags.ToString(); String Hidden = t.Hidden.ToString(); String IdleWaitDeadlineMinutes = t.IdleWaitDeadlineMinutes.ToString(); String IdleWaitMinutes = t.IdleWaitMinutes.ToString(); String MaxRunTime = t.MaxRunTime.ToString(); String MaxRunTimeLimited = t.MaxRunTimeLimited.ToString(); String MostRecentRunTime = t.MostRecentRunTime.ToString(); String Name = t.Name.ToString(); String NextRunTime = t.NextRunTime.ToString(); String Parameters = t.Parameters.ToString(); String Priority = t.Priority.ToString(); String Status = t.Status.ToString(); String WorkingDirectory = t.WorkingDirectory.ToString(); t.Close(); yield return(new opalisTask(Name, AccountName, ApplicationName, Comment, Creator, ExitCode, Flags, Hidden, IdleWaitDeadlineMinutes, IdleWaitMinutes, MaxRunTime, MaxRunTimeLimited, MostRecentRunTime, NextRunTime, Parameters, Priority, Status, WorkingDirectory)); } numberOfTasks = taskNames.Length; } else { Task t = st.OpenTask(taskName); String AccountName = t.AccountName.ToString(); String ApplicationName = t.ApplicationName.ToString(); String Comment = t.Comment.ToString(); String Creator = t.Creator.ToString(); String ExitCode = t.ExitCode.ToString(); String Flags = t.Flags.ToString(); String Hidden = t.Hidden.ToString(); String IdleWaitDeadlineMinutes = t.IdleWaitDeadlineMinutes.ToString(); String IdleWaitMinutes = t.IdleWaitMinutes.ToString(); String MaxRunTime = t.MaxRunTime.ToString(); String MaxRunTimeLimited = t.MaxRunTimeLimited.ToString(); String MostRecentRunTime = t.MostRecentRunTime.ToString(); String Name = t.Name.ToString(); String NextRunTime = t.NextRunTime.ToString(); String Parameters = t.Parameters.ToString(); String Priority = t.Priority.ToString(); String Status = t.Status.ToString(); String WorkingDirectory = t.WorkingDirectory.ToString(); t.Close(); numberOfTasks = 1; yield return(new opalisTask(Name, AccountName, ApplicationName, Comment, Creator, ExitCode, Flags, Hidden, IdleWaitDeadlineMinutes, IdleWaitMinutes, MaxRunTime, MaxRunTimeLimited, MostRecentRunTime, NextRunTime, Parameters, Priority, Status, WorkingDirectory)); } st.Dispose(); }