SmartFoxServer Silverlight API
SendPublicMessage Method (message, roomId)
Namespaces ► SmartFoxClientAPI ► SmartFoxClient ► SendPublicMessage(String, Int32)
Send a public message.
The message is broadcasted to all users in the current room, including the sender.
Declaration Syntax

C# | Visual Basic | Visual C++

    public void SendPublicMessage(
    	string message,
    	int roomId
    )

    Public Sub SendPublicMessage ( _
    	message As String, _
    	roomId As Integer _
    )

    public:
    void SendPublicMessage(
    	String^ message,
    	int roomId
    )

Parameters

message (String)
  the text of the public message.

roomId (Int32)
  the id of the target room, in case of multi-room join (optional, default value: activeRoomId).

Remarks

Sends:
SFSEvent..::.OnPublicMessageDelegate

Version:
SmartFoxServer Basic / Pro

Examples
The following example shows how to send and receive a public message.
CopyC#

    SFSEvent.onPublicMessage += OnPublicMessage;

    smartFox.SendPublicMessage("Hello world!");

    public void OnPublicMessage(string message, User sender, int roomId)
    {
        Debug.WriteLine("User " + sender.getName() + " said: " + message);
    }

See Also
SendPrivateMessage(String, Int32, Int32)
SFSEvent..::.OnPublicMessageDelegate

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