Share via


ApplicationContext.RegisterApplication Method

Registers an application and its entry points with Windows Media Center, or unregisters an application, removing all of its entry points from Windows Media Center.

Overload List

public static void RegisterApplication(
  Uri  uri,
  bool  unRegister,
  bool  allUsers
);
public static void RegisterApplication(
  System.Xml.XmlReader  reader,
  bool  unRegister,
  bool  allUsers,
  string  basePath
);

Parameters

uri

System.Uri.  The uniform resource identifier (URI) of the XML file that contains the registration information. This URI must use HTTP or HTTPS.

unRegister

System.Boolean.  Indicates whether to register or unregister the application. Set this parameter to false to register, or true to unregister.

allUsers

System.Boolean.  Indicates whether to register or unregister the application for all users, or just for the current user. Set this parameter to true to register for all users, or false to register for the current user only.

Note   Extender users cannot register entry points for all users, and attempting to do so results in a User Account Control (UAC) prompt.

reader

System.Xml.XmlReader.  An implementation of an XML reader that returns XML information for the application registration.

basePath

System.String.  A String that contains a path used to resolve relative paths specified in the registration information.

Return Value

This method does not return a value.

If this method fails, the following exceptions are possible:

Exception Description
ApplicationAlreadyRegisteredException The application is already registered and unRegister is false.
ApplicationNotRegisteredException The application isn't registered and unRegister is true.
ApplicationNoPermissionException The user does not have permission to register applications (in particular when allUsers is true).
ApplicationRegistrationCancelledException The user has denied the registration request.

Remarks

To register, a previously registered application must call this method on behalf of another Windows Media Center application.

The XML that is specified must contain a single application element with one or more nested entrypoint elements. Each entrypoint element must have one or more nested category elements.

An entry point is a link to a particular Windows Media Center page, and consists of an identifier, a URL, a title, a description, and an image. Each entry point must be associated with at least one Windows Media Center category, which determines the locations in the Windows Media Center user interface (UI) where the entry point is placed.

To unregister an application, use the same XML as was used to register the application.

Requirements

Reference: Microsoft.MediaCenter

Namespace: Microsoft.MediaCenter.Hosting

Assembly: Microsoft.MediaCenter.dll

Platform: Windows Vista Ultimate, Windows Vista Home Premium, and later

See Also