BeginSendChatMessage Method (String, Boolean, AsyncCallback, Object)
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.
Send a high priority message to the chat room. An alert message will be displayed within the group chat client using a different color (usually red) for emphasis. It will also, depending up on the users preferences, be announce by a bell, chime, or other sound effect. Users must first successfully join a chat room to initiate the session before a message can be sent.
Namespace: Microsoft.Rtc.Collaboration.GroupChat
Assembly: Microsoft.Rtc.Collaboration.GroupChat (in Microsoft.Rtc.Collaboration.GroupChat.dll)
Syntax
'Declaration
Public Function BeginSendChatMessage ( _
message As String, _
alert As Boolean, _
userCallback As AsyncCallback, _
state As Object _
) As IAsyncResult
'Usage
Dim instance As ChatRoomSession
Dim message As String
Dim alert As Boolean
Dim userCallback As AsyncCallback
Dim state As Object
Dim returnValue As IAsyncResult
returnValue = instance.BeginSendChatMessage(message, _
alert, userCallback, state)
public IAsyncResult BeginSendChatMessage(
string message,
bool alert,
AsyncCallback userCallback,
Object state
)
Parameters
- message
Type: System.String
The message.
- alert
Type: System.Boolean
If true, send this message as an alert; otherwise send the message with normal priority.
- userCallback
Type: System.AsyncCallback
The method to be invoked when this asynchronous operation completes.
- state
Type: System.Object
An object to be passed back to the callback.
Return Value
Type: System.IAsyncResult
An IAsyncResult that references this operation.
Exceptions
Exception | Condition |
---|---|
ArgumentException | Thrown when invalid arguments are passed. |
[Microsoft.Rtc.Collaboration.GroupChat.ChatServerConnectionException] | Thrown when the GroupChatEndpoint is not established. |
[Microsoft.Rtc.Collaboration.GroupChat.ChatRoomSessionStateException] | Thrown when the ChatRoomSession is not joined. |
[System.InvalidOperationException] | Thrown when the chat server connection is not in a valid state to send the command. |
[RealTimeException] | Thrown when the GroupChatEndpoint encounters an error communicating with the group chat server. |
Remarks
This request will be processed asynchronously. See EndSendChatMessage(IAsyncResult) to complete this asynchronous operation.