using System; using System.ComponentModel; using System.Windows.Forms; namespace Microsoft.Win32.TaskScheduler { /// /// Dialog that will display the run times for a provided task. /// [ToolboxItem(true), ToolboxItemFilter("System.Windows.Forms.Control.TopLevel"), DesignTimeVisible(true), Description("Dialog that will display the run times for a provided task."), Designer("System.ComponentModel.Design.ComponentDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")] [System.Drawing.ToolboxBitmap(typeof(TaskEditDialog), "TaskDialog")] public partial class TaskRunTimesDialog : #if DEBUG Form #else DialogBase #endif { /// /// Initializes a new instance of the class. /// public TaskRunTimesDialog() { InitializeComponent(); } /// /// Initializes a new instance of the class. /// /// The task to display. /// The date to begin looking for run times. /// The date to end looking for run times. public TaskRunTimesDialog(Task task, DateTime startDate, DateTime endDate) { InitializeComponent(); Initialize(task, startDate, endDate); } /// /// Gets or sets the task. /// /// The task. [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] public Task Task { get { return taskRunTimesControl1.Task; } set { taskRunTimesControl1.Task = value; } } /// /// Gets or sets the start date. /// /// The start date. [Category("Data"), Description("The date to start looking for run times.")] public DateTime StartDate { get { return taskRunTimesControl1.StartDate; } set { taskRunTimesControl1.StartDate = value; } } /// /// Gets or sets the end date. /// /// The end date. [Category("Data"), Description("The date to end looking for run times.")] public DateTime EndDate { get { return taskRunTimesControl1.EndDate; } set { taskRunTimesControl1.EndDate = value; } } /// /// Initializes the dialog with the specified task. /// /// The task. /// The start date. /// The end date. protected void Initialize(Task task, DateTime? startDate, DateTime? endDate) { taskRunTimesControl1.Initialize(task, startDate, endDate); } private bool ShouldSerializeEndDate() { return taskRunTimesControl1.ShouldSerializeEndDate(); } private bool ShouldSerializeStartDate() { return taskRunTimesControl1.ShouldSerializeStartDate(); } } }