ScheduledActionService.LaunchForTest Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
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 for Windows Phone 8. 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.
Caution: |
|---|
You should set the delay value to at least 60 seconds to ensure that the background agent will be launched. Delay times less than 60 seconds may result in the background agent not being launched. |
Caution: