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)

提示使用者之後,起始重要內容保護元件的更新。

適用於