GadgetRegistration.Register Method (Boolean, Guid, Guid, String, String, String, Boolean, GadgetCachePolicies, Generic Nullable)

Registers a SideShow gadget with Windows.

Namespace: Microsoft.SideShow
Assembly: Microsoft.SideShow (in microsoft.sideshow.dll)

Usage

Syntax

'Declaration
Public Shared Sub Register ( _
    registerForAllUsers As Boolean, _
    gadgetId As Guid, _
    endpointId As Guid, _
    friendlyName As String, _
    startCmd As String, _
    iconPathNameAndResourceId As String, _
    onlineOnly As Boolean, _
    policy As GadgetCachePolicies, _
    propertyPage As Nullable(Of Guid) _
)
public static void Register (
    bool registerForAllUsers,
    Guid gadgetId,
    Guid endpointId,
    string friendlyName,
    string startCmd,
    string iconPathNameAndResourceId,
    bool onlineOnly,
    GadgetCachePolicies policy,
    Nullable<Guid> propertyPage
)
public:
static void Register (
    bool registerForAllUsers, 
    Guid gadgetId, 
    Guid endpointId, 
    String^ friendlyName, 
    String^ startCmd, 
    String^ iconPathNameAndResourceId, 
    bool onlineOnly, 
    GadgetCachePolicies policy, 
    Nullable<Guid> propertyPage
)
public static void Register (
    boolean registerForAllUsers, 
    Guid gadgetId, 
    Guid endpointId, 
    String friendlyName, 
    String startCmd, 
    String iconPathNameAndResourceId, 
    boolean onlineOnly, 
    GadgetCachePolicies policy, 
    Nullable<Guid> propertyPage
)
public static function Register (
    registerForAllUsers : boolean, 
    gadgetId : Guid, 
    endpointId : Guid, 
    friendlyName : String, 
    startCmd : String, 
    iconPathNameAndResourceId : String, 
    onlineOnly : boolean, 
    policy : GadgetCachePolicies, 
    propertyPage : Nullable<Guid>
)

Parameters

  • registerForAllUsers
    Indicates whether to register the gadget for all users, or just for the current user. Set this parameter to true to register the gadget for all users, or false to register the gadget for the current user only.
  • gadgetId
    A Guid that identifies the gadget's ID.
  • endpointId
    A Guid that identifies the kind of content produced by the gadget.
  • friendlyName
    A String that identifies the gadget's friendly name.
  • startCmd
    A String that identifies the command used to start the application that contains the gadget's code.
  • iconPathNameAndResourceId
    A String that identifies the path of the file that contains the gadget's icon and the resource ID of the icon.
  • onlineOnly
    A Boolean that indicates whether Windows should run this gadget's application when the user enters the gadget on a device.
  • policy
    A GadgetCachePolicies value that indicates how Windows SideShow-compatible devices should control the caching of this gadget's content.
  • propertyPage
    A Guid that identifies this gadget's property page implementation.

Example

This example code registers a gadget with Windows.

private static void SampleRegister()
{
    // Set the gadget's GUID.
    Guid gadgetId = new Guid("{0530B726-F6D5-4a66-900E-3C7673316F3B}");
    // Register the gadget.
    GadgetRegistration.Register(
        false,                           // Register gadget for current user only
        gadgetId,                        // Guid for the registry subkey
        ScfSideShowGadget.ScfEndpointId, // Endpoints registry value
        "Example SideShow gadget",       // FriendlyName registry value
        null,                            // StartCommand registry value
        null,                            // Icon registry value, this gadget will use the generic gadget icon.
        false,                           // OnlineOnly registry value
        GadgetCachePolicies.KeepNewest,  // CachePolicy registry value
        null);                           // PropertyPage registry value
}

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Vista Home Premium, Windows Vista Business, Windows Vista Enterprise, Windows Vista Ultimate

Target Platforms

Windows Vista Home Premium, Windows Vista Business, Windows Vista Enterprise, Windows Vista Ultimate

See Also

Reference

GadgetRegistration Class
GadgetRegistration Members
Microsoft.SideShow Namespace