| 1234567891011121314151617181920212223242526 |
- using GreenTree.Nachtragsmanagement.Core.Plugins;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace GreenTree.Nachtragsmanagement.Services.Misc
- {
- public class NotificationService : INotificationService
- {
- /// <summary>
- /// Searches for all implementations of the INotificationPlugin
- /// </summary>
- public IEnumerable<INotificationPlugin> GetNotificationPlugins()
- {
- var type = typeof(INotificationPlugin);
- var types = AppDomain.CurrentDomain.GetAssemblies()
- .SelectMany(s => s.GetTypes())
- .Where(p => type.IsAssignableFrom(p) && !p.IsInterface)
- .OfType<INotificationPlugin>();
- return types;
- }
- }
- }
|