Edit

Share via


InstantMessagingFlow.LocalComposingState Property

Definition

Gets or sets the local composing state.

public:
 property Microsoft::Rtc::Collaboration::ComposingState LocalComposingState { Microsoft::Rtc::Collaboration::ComposingState get(); void set(Microsoft::Rtc::Collaboration::ComposingState value); };
public Microsoft.Rtc.Collaboration.ComposingState LocalComposingState { get; set; }
member this.LocalComposingState : Microsoft.Rtc.Collaboration.ComposingState with get, set
Public Property LocalComposingState As ComposingState

Property Value

Examples

This example shows how to set the composing state. This sample assumes that the InstantMessagingCall has been established and the flow configured.

C# Setting composing state

private void SendMessageCompleted(IAsyncResult result)
{
    try
    {
        InstantMessagingCall call = result.AsyncState as InstantMessagingCall;
        SendInstantMessageResult imResult = call.Flow.EndSendInstantMessage(result);
        if (imResult.DeliveryFailures.Count > 0)
        {
            // One or more recipients did not receive the message.
            foreach (MessageDeliveryFailureData failure in imResult.DeliveryFailures)
            {
                Console.WriteLine("Message not received by {0} ({1})", failure.Recipient.Uri, failure.ResponseCode);
            }
        }
        else if (imResult.MessageId != null)
        {
            Console.WriteLine("Message response was tentative with message id {0}", imResult.MessageId.MessageId);

        }
        else
        {
            Console.WriteLine("Message received by all participants.");
        }
    }
    catch (RealTimeException exception)
    {
        // TODO: Replace with exception handling code.
        Console.WriteLine("Message send failed: {0}", exception.Message);
    }
    finally
    {
        // TODO: Add clean up code here.
    }

}


Remarks

Setting the state will automatically send "Composing" notifications to remote participants. Once set to "Composing", automatic refresh of the "Composing" state occurs every 5 seconds until a message is sent or the state is set explicitly to "Idle". If a message is sent, it is not necessary to set to Idle since the composing state will be automatically reset to Idle. Note that the RemoteComposingStateChanged event will not be raised when this property is set.

Applies to