📄 taskscheduler.cs
字号:
using System;
using System.Collections;
using System.Runtime.InteropServices;
using TaskSchedulerInterop;
namespace TaskScheduler
{
/// <remarks>
/// Encapsulates the system task scheduler.
/// </remarks>
/// <example>
/// Example creates a local instance of the Task Scheduler and prints the tasks
/// <code>
/// Scheduler sched = new Scheduler();
/// foreach (Task t in sched.Tasks)
/// {
/// Console.WriteLine(t.ToString());
/// }
/// </code>
/// </example>
public class Scheduler
{
/// <summary>
/// Internal field which holds TaskList instance
/// </summary>
private readonly TaskList tasks = null;
/// <summary>
/// Creates instance of task scheduler on local machine
/// </summary>
public Scheduler()
{
tasks = new TaskList();
}
/// <summary>
/// Creates instance of task scheduler on remote machine
/// </summary>
/// <param name="computer">Name of remote machine</param>
public Scheduler(string computer)
{
tasks = new TaskList();
TargetComputer = computer;
}
/// <summary>
/// Gets/sets name of target computer. Null or emptry string specifies local computer.
/// </summary>
public string TargetComputer
{
get
{
return tasks.TargetComputer;
}
set
{
tasks.TargetComputer = value;
}
}
/// <summary>
/// Gets collection of system tasks
/// </summary>
public TaskList Tasks
{
get
{
return tasks;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -