DataSource.NET
CreateSubjectStatusEvent Method (subject, status, message)
NamespacesCaplin.DataSource.MessagingIMessageFactoryCreateSubjectStatusEvent(String, SubjectStatus, String)
Creates a subject status event.
Declaration Syntax
C#Visual BasicVisual C++
ISubjectStatusEvent CreateSubjectStatusEvent(
	string subject,
	SubjectStatus status,
	string message
)
Function CreateSubjectStatusEvent ( _
	subject As String, _
	status As SubjectStatus, _
	message As String _
) As ISubjectStatusEvent
ISubjectStatusEvent^ CreateSubjectStatusEvent(
	String^ subject, 
	SubjectStatus status, 
	String^ message
)
Parameters
subject (String)
The subject to which the status relates.
status (SubjectStatus)
The status.
message (String)
A free form textual message indicating the reason for the status message being raised.
Return Value
A subject status event.
Examples
The following example shows how to create an ISubjectStatusEvent for a specified subject, and send it to all peers that have requested that subject.
CopyC#
using Caplin.DataSource;
using Caplin.DataSource.Messaging;
using Caplin.DataSource.Messaging.Record;
using Caplin.DataSource.Publisher;

namespace DataSourceExamples.Messaging
{
    public class SendSubjectStatusEvent
    {
        void SendSubjectStatusToSubscribedPeers(IPublisher publisher, string subject)
        {
            // Create a Stale subject status event.
            ISubjectStatusEvent ev = publisher.MessageFactory.CreateSubjectStatusEvent(subject, SubjectStatus.Stale, "Object is stale");

            // And publisher to all subscribed peers.
            publisher.PublishSubjectStatusEvent(ev);
        }
    }
}

Assembly: DataSource.NET (Module: DataSource.NET) Version: 6.2.6.2123 (6.2.6.2123)