|
|
Schedule
|
[ToolboxBitmapAttribute(typeof(ScheduleManager))] public class ScheduleManager : Component, ISupportLifecycle, IDisposable, ISupportInitialize, IProvideStatus, IPersistSettings
The ScheduleManager type exposes the following members.
| Name | Description | |
|---|---|---|
| ScheduleManager | Initializes a new instance of the ScheduleManager class. | |
| ScheduleManager(IContainer) | Initializes a new instance of the ScheduleManager class. |
| Name | Description | |
|---|---|---|
| CanRaiseEvents | Gets a value indicating whether the component can raise an event. (Inherited from Component) | |
| Container | Gets the IContainer that contains the Component. (Inherited from Component) | |
| DesignMode | Gets a value that indicates whether the Component is currently in design mode. (Inherited from Component) | |
| Enabled | Gets or sets a boolean value that indicates whether the ScheduleManager object is currently enabled. | |
| Events | Gets the list of event handlers that are attached to this Component. (Inherited from Component) | |
| IsDisposed | Gets a flag that indicates whether the object has been disposed. | |
| IsRunning | Gets a boolean value that indicates whether the ScheduleManager is running. | |
| Name | Gets the unique identifier of the ScheduleManager object. | |
| PersistSettings | Gets or sets a boolean value that indicates whether the settings of ScheduleManager object are to be saved to the config file. | |
| Schedules | Gets a list of all Schedule monitored by the ScheduleManager object. | |
| SettingsCategory | Gets or sets the category under which the settings of ScheduleManager object are to be saved to the config file if the PersistSettings property is set to true. | |
| Site | Gets or sets the ISite of the Component. (Inherited from Component) | |
| Status | Gets the descriptive status of the ScheduleManager object. |
| Name | Description | |
|---|---|---|
| AddSchedule(String, String) | Attempts to add a new Schedule. | |
| AddSchedule(String, String, Boolean) | Attempts to add a new Schedule. | |
| AddSchedule(String, String, String) | Attempts to add a new Schedule. | |
| AddSchedule(String, String, String, Boolean) | Attempts to add a new Schedule. | |
| BeginInit | Performs necessary operations before the ScheduleManager object properties are initialized. | |
| CheckAllSchedules | Checks all of the Schedules to determine if they are due. | |
| CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject) | |
| Dispose | Releases all resources used by the Component. (Inherited from Component) | |
| Dispose(Boolean) |
Releases the unmanaged resources used by the ScheduleManager object and optionally releases the managed resources.
(Overrides ComponentDispose(Boolean)) | |
| EndInit | Performs necessary operations after the ScheduleManager object properties are initialized. | |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
| Finalize | Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection. (Inherited from Component) | |
| FindSchedule | Searches for the Schedule with the specified name. | |
| GetHashCode | Serves as the default hash function. (Inherited from Object) | |
| GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject) | |
| GetService | Returns an object that represents a service provided by the Component or by its Container. (Inherited from Component) | |
| GetType | Gets the Type of the current instance. (Inherited from Object) | |
| Initialize | Initializes the ScheduleManager object. | |
| InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject) | |
| LoadSettings | Loads saved settings for the ScheduleManager object from the config file if the PersistSettings property is set to true. | |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) | |
| MemberwiseClone(Boolean) | Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject) | |
| OnScheduleDue | Raises the ScheduleDue event. | |
| OnScheduleDueCheck | Raises the ScheduleDueCheck event. | |
| OnStarted | Raises the Started event. | |
| OnStarting | Raises the Starting event. | |
| RemoveSchedule | Attempts to remove a Schedule with the specified name if one exists. | |
| SaveSettings | Saves settings for the ScheduleManager object to the config file if the PersistSettings property is set to true. | |
| Start | Starts the ScheduleManager asynchronously if not running. | |
| Stop | Stops the ScheduleManager if running. | |
| ToString | Returns a String containing the name of the Component, if any. This method should not be overridden. (Inherited from Component) |
| Name | Description | |
|---|---|---|
| Disposed | Occurs when the component is disposed by a call to the Dispose method. (Inherited from Component) | |
| ScheduleDue | Occurs asynchronously when a Schedule is due according to the rule specified for it. | |
| ScheduleDueCheck | Occurs when the a particular Schedule is being checked to see if it is due. | |
| Started | Occurs when the ScheduleManager has started at the top of the minute. | |
| Starting | Occurs while the ScheduleManager is waiting to start at the top of the minute. |
| Name | Description | |
|---|---|---|
| DefaultPersistSettings | Specifies the default value for the PersistSettings property. | |
| DefaultSettingsCategory | Specifies the default value for the SettingsCategory property. |
| Name | Description | |
|---|---|---|
| GetEnumValueOrDefault |
Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions) | |
| GetEnumValueOrDefaultT |
Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions) |
using System; using GSF; using GSF.Scheduling; class Program { static void Main(string[] args) { ScheduleManager scheduler = new ScheduleManager(); scheduler.Initialize(); // Add event handlers. scheduler.Starting += scheduler_Starting; scheduler.Started += scheduler_Started; scheduler.ScheduleDue += scheduler_ScheduleDue; // Add test schedules. scheduler.AddSchedule("Run.Notepad", "* * * * *"); scheduler.AddSchedule("Run.Explorer", "* * * * *"); // Start the scheduler. scheduler.Start(); Console.ReadLine(); } static void scheduler_Started(object sender, EventArgs e) { Console.WriteLine("Scheduler has started successfully."); } static void scheduler_Starting(object sender, EventArgs e) { Console.WriteLine("Scheduler is waiting to be started."); } static void scheduler_ScheduleDue(object sender, EventArgs<Schedule> e) { Console.WriteLine(string.Format("{0} schedule is due for processing.", e.Argument.Name)); } }