2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-07-03 01:03:41 -04:00

Add project files.

This commit is contained in:
Xjph
2021-06-03 22:25:32 -02:30
parent 7099cf23c6
commit a5154996ee
32 changed files with 2287 additions and 0 deletions

View File

@ -0,0 +1,48 @@
using Observatory.Framework;
using Observatory.Framework.Interfaces;
using Observatory.Framework.Files;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Observatory.Framework.Files.Journal;
namespace Observatory.PluginManagement
{
class PluginEventHandler
{
private IEnumerable<IObservatoryWorker> observatoryWorkers;
private IEnumerable<IObservatoryNotifier> observatoryNotifiers;
public PluginEventHandler(IEnumerable<IObservatoryWorker> observatoryWorkers, IEnumerable<IObservatoryNotifier> observatoryNotifiers)
{
this.observatoryWorkers = observatoryWorkers;
this.observatoryNotifiers = observatoryNotifiers;
}
public void OnJournalEvent(object source, JournalEventArgs journalEventArgs)
{
foreach (var worker in observatoryWorkers)
{
worker.JournalEvent((JournalBase)journalEventArgs.journalEvent);
}
}
public void OnStatusUpdate(object sourece, JournalEventArgs journalEventArgs)
{
foreach (var worker in observatoryWorkers)
{
worker.StatusChange((Status)journalEventArgs.journalEvent);
}
}
public void OnNotificationEvent(object source, NotificationEventArgs notificationEventArgs)
{
foreach (var notifier in observatoryNotifiers)
{
notifier.OnNotificationEvent(notificationEventArgs.Title, notificationEventArgs.Detail);
}
}
}
}