1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-11-01 08:22:35 +01:00
Sonarr/NzbDrone/Router.cs

52 lines
1.5 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NzbDrone.Model;
using NzbDrone.Providers;
namespace NzbDrone
{
class Router
{
2011-10-11 09:11:05 +02:00
private readonly ApplicationServer _applicationServer;
private readonly ServiceProvider _serviceProvider;
private readonly ConsoleProvider _consoleProvider;
2011-10-11 09:11:05 +02:00
public Router(ApplicationServer applicationServer, ServiceProvider serviceProvider, ConsoleProvider consoleProvider)
{
2011-10-11 09:11:05 +02:00
_applicationServer = applicationServer;
_serviceProvider = serviceProvider;
2011-10-11 09:11:05 +02:00
_consoleProvider = consoleProvider;
}
public void Route()
{
2011-10-11 09:11:05 +02:00
switch (CentralDispatch.ApplicationMode)
{
case ApplicationMode.Console:
{
2011-10-11 09:11:05 +02:00
_applicationServer.Start();
_consoleProvider.WaitForClose();
break;
}
case ApplicationMode.InstallService:
{
_serviceProvider.Install();
break;
}
case ApplicationMode.UninstallService:
{
_serviceProvider.UnInstall();
break;
}
default:
{
_consoleProvider.PrintHelp();
break;
}
}
}
}
}