SmartFoxServer Silverlight API
SendPrivateMessage Method (message, recipientId, roomId)
NamespacesSmartFoxClientAPISmartFoxClientSendPrivateMessage(String, Int32, Int32)
Send a private message to a user.
The message is broadcasted to the recipient and the sender.
Declaration Syntax
C#Visual BasicVisual C++
public void SendPrivateMessage(
	string message,
	int recipientId,
	int roomId
)
Public Sub SendPrivateMessage ( _
	message As String, _
	recipientId As Integer, _
	roomId As Integer _
)
public:
void SendPrivateMessage(
	String^ message, 
	int recipientId, 
	int roomId
)
Parameters
message (String)
the text of the public message.
recipientId (Int32)
the id of the recipient user.
roomId (Int32)
the id of the room from where the message is sent, in case of multi-room join (optional, default value: activeRoomId).
Remarks

Sends:
SFSEvent..::.OnPrivateMessageDelegate

Version:
SmartFoxServer Basic / Pro

Examples
The following example shows how to send and receive a private message.
CopyC#
SFSEvent.onPrivateMessage += OnPrivateMessage;

smartFox.SendPrivateMessage("Hallo Jack!", 22);

public void OnPrivateMessage(string message, User sender, int roomId, int userId)
{
    Debug.WriteLine("User " + sender.getName() + " sent the following private message: " + message);
}
See Also

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