StreamLink.NET  7.1.6-7.1.6-3952-ee12172
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
Public Member Functions | List of all members
Caplin.StreamLink.Alerts.INotificationListener Interface Reference

Interface that should be implemented to receive notification change callbacks from the NotificationProvider More...

Public Member Functions

void OnNotification (Caplin.StreamLink.Alerts.INotification notification)
 Received when notification gets added to the container. More...
 
void OnNotificationRemoved (Caplin.StreamLink.Alerts.INotification notification)
 Received when notification is removed from the container. More...
 
void OnServiceStatus (Caplin.StreamLink.ServiceStatus status)
 Received when the notification service availability changes. More...
 

Detailed Description

Interface that should be implemented to receive notification change callbacks from the NotificationProvider

A trivial implementation of NotificationListener would be:

using Caplin.StreamLink;
using Caplin.StreamLink.Alerts;
using System;
namespace caplin.streamlink.examplesnippets.alerts
{
public class NotificationListenerSnippet
{
private NotificationService notificationService;
public NotificationListenerSnippet( IStreamLink streamLink )
{
this.notificationService = new NotificationService(streamLink);
this.notificationService.AddListener(new ExampleNotificationListener());
}
class ExampleNotificationListener : INotificationListener
{
public void OnNotificationRemoved( INotification notification )
{
Console.WriteLine("OnNotificationRemoved(" + notification.ToString() + ")");
}
public void OnNotification( INotification notification )
{
Console.WriteLine("OnNotification(" + notification.ToString() + ")");
}
public void OnServiceStatus( ServiceStatus status )
{
Console.WriteLine("OnServiceStatus(" + status + ")");
}
}
}
}

Member Function Documentation

void Caplin.StreamLink.Alerts.INotificationListener.OnNotification ( Caplin.StreamLink.Alerts.INotification  notification)

Received when notification gets added to the container.

void Caplin.StreamLink.Alerts.INotificationListener.OnNotificationRemoved ( Caplin.StreamLink.Alerts.INotification  notification)

Received when notification is removed from the container.

void Caplin.StreamLink.Alerts.INotificationListener.OnServiceStatus ( Caplin.StreamLink.ServiceStatus  status)

Received when the notification service availability changes.


Generated on Tue Apr 28 2020 06:25:31 for StreamLink.NET