Share via


PreviewBuildsManager Class

Definition

Manages the state of preview builds for the device.

public ref class PreviewBuildsManager sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 393216)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class PreviewBuildsManager final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 393216)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class PreviewBuildsManager
Public NotInheritable Class PreviewBuildsManager
Inheritance
Object Platform::Object IInspectable PreviewBuildsManager
Attributes

Windows requirements

Device family
Windows 10, version 1803 (introduced in 10.0.17134.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v6.0)

Examples

As an examples, after enabling Windows Insider Preview builds in the device's settings page an OEM device developer might use this code example to get an activation code to register the device within the Windows Insider Registration Portal.

public async Task<string> ActivateDevice() 
{ 
    PreviewBuildsManager manager = PreviewBuildsManager.GetDefault(); 
    if (manager != null) 
    { 
        // The user wants to activate their device to receive Windows Insider Preview Builds 
        manager.ArePreviewBuildsAllowed = true; 

        await manager.SyncAsync(); 

        PreviewBuildsState state = manager.GetCurrentState(); 
        string activationCode; 
        if (state.Properties.ContainsKey("ActivationCode")) 
        { 
            return state.Properties["ActivationCode"].ToString(); 
        } 
    } 
    return String.Empty; 
} 

Properties

ArePreviewBuildsAllowed

A boolean value describing whether preview builds are allowed on the device.

Methods

GetCurrentState()

The current state of the PreviewBuildsState object.

GetDefault()

Gets the default PreviewBuildsManager from the device.

IsSupported()

Determines if this API is supported on the device.

SyncAsync()

Syncs the PreviewBuildsManager with the server to get current information.

Applies to