The ReportMessageQueue property returns a string collection of messages from the runtime system as a response from the initiation of a video report that directs its output to the client application.
You can register for the CollectionChanged event on an ObservableCollection that notifies the client when an update has been performed on the collection; that is, when a new message has been received from the host application.
Namespace – ABSuite.AccessLayer.Connector.Core
Assembly – Unisys.ABSuite.AccessLayer.Connector.Core (in Unisys.ABSuite.AccessLayer.Connector.Core.dll)
Syntax
IEnumerable<string> ReportMessageQueue { get; }
Using the IUnsolicitedMessages Interface for the ReportMessageQueue Property
The following code is an example of using the ReportMessageQueue property for handling video report responses:
// Declare a StringBuilder to hold the Report Responses ReportResponesBuilder = new StringBuilder(); // Register for the CollectionChanged event for notification of // new messages ABSConnection.MessagesHandler.ReportMessageQueue.CollectionChanged += (o, e) => { this.QueueUpdate(e, ABSConnection.MessagesHandler.ReportMessageQueue, this.ReportResponesBuilder); }; // The QueueUpdate method handles changes in the // ObeservableCollection of command and video report responses. // When a message arrives, it is added to the StringBuilder parameter. // If the Collection is Reset, the StringBuilder parameter is // cleared and new messages are added. private void QueueUpdate(NotifyCollectionChangedEventArgs e, IList<string> items, StringBuilder builder) { switch (e.Action) { case NotifyCollectionChangedAction.Add: if (e.NewItems != null) { foreach (string item in e.NewItems) { if (item.Trim() == ">") builder.Append(item); else builder.AppendLine(item); } } break; case NotifyCollectionChangedAction.Remove: case NotifyCollectionChangedAction.Replace: break; case NotifyCollectionChangedAction.Reset: { builder.Clear(); foreach (string item in items) builder.AppendLine(item); } break; } }