ChatMessageStore.GetMessageReader Method

Definition

Overloads

GetMessageReader(TimeSpan)

Gets a ChatMessageReader class object which provides a message collection from the message store. The collection of messages is limited to the time span provided.

GetMessageReader()

Gets a ChatMessageReader class object which provides a message collection from the message store.

GetMessageReader(TimeSpan)

Gets a ChatMessageReader class object which provides a message collection from the message store. The collection of messages is limited to the time span provided.

public:
 virtual ChatMessageReader ^ GetMessageReader(TimeSpan recentTimeLimit) = GetMessageReader;
/// [Windows.Foundation.Metadata.Overload("GetMessageReader2")]
ChatMessageReader GetMessageReader(TimeSpan const& recentTimeLimit);
[Windows.Foundation.Metadata.Overload("GetMessageReader2")]
public ChatMessageReader GetMessageReader(System.TimeSpan recentTimeLimit);
function getMessageReader(recentTimeLimit)
Public Function GetMessageReader (recentTimeLimit As TimeSpan) As ChatMessageReader

Parameters

recentTimeLimit
TimeSpan TimeSpan

The time window for the retrieved reader.

Returns

The chat message reader.

Attributes

Windows requirements

App capabilities
chat chatSystem smsSend

See also

Applies to

GetMessageReader()

Gets a ChatMessageReader class object which provides a message collection from the message store.

public:
 virtual ChatMessageReader ^ GetMessageReader() = GetMessageReader;
/// [Windows.Foundation.Metadata.Overload("GetMessageReader1")]
ChatMessageReader GetMessageReader();
[Windows.Foundation.Metadata.Overload("GetMessageReader1")]
public ChatMessageReader GetMessageReader();
function getMessageReader()
Public Function GetMessageReader () As ChatMessageReader

Returns

The chat message reader.

Attributes

Windows requirements

App capabilities
chat chatSystem smsSend

Remarks

The following example uses the message reader to find the first message that has a subject containing a simple search string:

async ChatMessage SearchMessagesBySubject(ChatMesssage store, string searchItem)
{
    ChatMessage foundMessage = null;
    IReadOnlyList<ChatMessage> messageList = await store.GetMessageReader().ReadBatchAsync();
    if (messageList.Count > 0)
    {
        foreach(ChatMessage message in messageList)
        {
            If (message.Subject.Contains(searchItem))
            {
                foundMessage = message;{
                break;
            }
        }
    }
    return foundMessage;
}

See also

Applies to