共用方式為


GamerServicesDispatcher.Initialize Method

Initializes gamer services functionality for the game.

Call this method during startup of your game.

Namespace: Microsoft.Xna.Framework.GamerServices
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Syntax

public static void Initialize (
         IServiceProvider serviceProvider
)

Parameters

  • serviceProvider
    The service provider to be used when locating additional services services. For example, IGraphicsDeviceService.

Exceptions

Exception type Condition
GamerServicesNotAvailableException
  • If the current game uses the XNA Framework Redistributable. This file does not include Games for Windows – LIVE functionality.
  • If another Games for Windows – LIVE title is running already.
ArgumentNullException serviceProvider is null.
InvalidOperationException The gamer services functionality is already initialized.

Remarks

Important

Games for Windows - LIVE is not available to finished games. This functionality is not included in the redistributable version of the XNA Framework, and a game that attempts to use these components without XNA Game Studio installed will result in a GamerServicesNotAvailableException.

See Also

Tasks

How To: Initialize and Update the Gamer Services Dispatcher

Concepts

Gamer Services Overview

Reference

GamerServicesDispatcher Class
GamerServicesDispatcher Members
Microsoft.Xna.Framework.GamerServices Namespace

Platforms

Xbox 360, Windows XP SP2, Windows Vista, Zune