ComponentRenewal 类

定义

使应用程序能够启动需要更新才能播放受保护媒体内容的组件的续订。

public ref class ComponentRenewal abstract sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Media.Protection.ProtectionRenewalContract, 65536)]
class ComponentRenewal final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Media.Protection.ProtectionRenewalContract), 65536)]
public static class ComponentRenewal
Public Class ComponentRenewal
继承
Object Platform::Object IInspectable ComponentRenewal
属性

Windows 要求

设备系列
Windows Desktop Extension SDK (在 10.0.10240.0 中引入)
API contract
Windows.Media.Protection.ProtectionRenewalContract (在 v1.0 中引入)

示例

此示例演示 ComponentLoadFailedEventHandler。 循环循环访问失败的组件。 并调用 RenewSystemComponentsAsync 。 请注意, RevocationAndRenewalInformation 是通过 ComponentLoadFailedEventArgs 传入的

private async void Manager_ComponentLoadFailed(MediaProtectionManager sender, ComponentLoadFailedEventArgs e)
{
    for (var i = 0; i < e.Information.Items.Count; i++)
    {
        Debug.WriteLine('Component Name=' +
                    e.Information.Items[i].Name +
                    "<BR/>");
        Debug.WriteLine('Failure Reason=' +
                    e.Information.Items[i].Reasons.ToString(16) +
                    "<BR/>");
        Debug.WriteLine('Renewal GUID=' +
                    e.Information.Items[i].RenewalId +
                    "<BR/>");
    }



    //  Invoke the revocation               
    var renewalStatus = await ComponentRenewal.RenewSystemComponentsAsync(e.Information);
    Debug.WriteLine("RenewSystemComponentsAsync: " +
                    renewalStatus.ToString() +
                    "<BR/>");

    e.Completion.Complete(false);
}

方法

RenewSystemComponentsAsync(RevocationAndRenewalInformation)

在提示用户后启动关键内容保护组件的更新。

适用于