ScheduledActionService.LaunchForTest Method
March 22, 2012
Causes the background agent associated with a ScheduledTask to be run in the background after the specified delay.
Assembly: Microsoft.Phone (in Microsoft.Phone.dll)
Parameters
- name
- Type: System.String
The name that uniquely identifies the ScheduledTask object.
- delay
- Type: System.TimeSpan
The delay after which the associated background agent should be run.
| Exception | Condition |
|---|---|
| InvalidOperationException |
A ScheduledTask with the specified name is not registered with the Scheduled Action Service. The ExpirationTime for the ScheduledTask has already passed. |
| NotSupportedException |
The supplied object is not a ScheduledTask object. |
Use this method during application development to test your background agent implementation. Background agents are launched by the operating system according to the type of agent and the current state of the system. This scheduling logic is described in Background Agents Overview for Windows Phone. You can use this method to launch an agent more frequently from your foreground application or from the agent itself in order to test the agent execution. This method should only be used during development. You should remove calls to this method from your production application.