SmartFoxServer Silverlight API
SFSEvent..::.OnPlayerSwitchedDelegate Delegate
NamespacesSmartFoxClientAPISFSEventSFSEvent..::.OnPlayerSwitchedDelegate
Dispatched in response to the SwitchPlayer(Int32) request.
The request to turn a player into a spectator may fail if another user did the same before your request, and there was only one spectator slot available.
Declaration Syntax
C#Visual BasicVisual C++
public delegate void OnPlayerSwitchedDelegate(
	bool success,
	int newId,
	Room room
)
Public Delegate Sub OnPlayerSwitchedDelegate ( _
	success As Boolean, _
	newId As Integer, _
	room As Room _
)
public delegate void OnPlayerSwitchedDelegate(
	bool success, 
	int newId, 
	Room^ room
)
Parameters
success (Boolean)
the switch result: true if the player was turned into a spectator, otherwise false.
newId (Int32)
the player id assigned by the server to the user.
room (Room)
the Room object representing the room where the switch occurred.
Remarks

Version:
SmartFoxServer Pro

Examples
The following example shows how to check the handle the player switch.
CopyC#
SFSEvent.onPlayerSwitched += OnPlayerSwitched;

smartFox.SwitchPlayer();

public void OnPlayerSwitched(bool success, int newId, Room room)
{
    if (success)
        Debug.WriteLine("You have been turned into a spectator; your id is " + newId);
    else
        Debug.WriteLine("The attempt to switch from player to spectator failed");
}
See Also

Assembly: SmartFoxClientAPI_Silverlight (Module: SmartFoxClientAPI_Silverlight) Version: 1.0.0.0 (1.0.0.0)