ServiceRequestedEventArgs Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Contains event data for a MediaProtectionManager object when a service is requested.
public ref class ServiceRequestedEventArgs sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class ServiceRequestedEventArgs final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class ServiceRequestedEventArgs
Public NotInheritable Class ServiceRequestedEventArgs
- Inheritance
- Attributes
Windows requirements
Device family |
Windows 10 (introduced in 10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v1.0)
|
Examples
The following example shows how to create a MediaProtectionManager, set the Properties property, and add event listeners for ComponentLoadFailed and ServiceRequested. See the How to use pluggable DRM topic for the full example. ```javascript
mediaProtectionManager = new Windows.Media.Protection.MediaProtectionManager();
function ServiceRequested(e) { logMsg("Got Enabler - system/type: {" + e.request.protectionSystem + "}/{" + e.request.type + "}"); e.completion.complete(true); }
function ComponentLoadFailed(e) { logMsg(e.information.items.size.toString() + " failed components"); logMsg("
Components:
");// List the failing components for (var i = 0; i < e.information.items.size; i++) { logMsg("
" + e.information.items[i].name + "
" + "Reasons=0x" + e.information.items[i].reasons.toString(16) + "
Renewal Id=" + e.information.items[i].renewalId); }
e.completion.complete(false); }
function RebootNeeded(e) { logMsg("Reboot Required"); }
mediaProtectionManager.addEventListener("servicerequested", ServiceRequested, false); mediaProtectionManager.addEventListener("componentloadfailed", ComponentLoadFailed, false); mediaProtectionManager.addEventListener("rebootneeded", RebootNeeded, false);
Remarks
This object is not instantiated directly. It is created by the MediaProtectionManager.ServiceRequested event and is returned as an argument to the ServiceRequestedEventHandler delegate.
Properties
Completion |
Returns an indication of the completion of the service request. |
MediaPlaybackItem |
Gets the MediaPlaybackItem associated with the service request. |
Request |
Contains the service request. |