From f26a3e3c615474eb9f64f005448bb8ce4b08e13f Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Sun, 3 Mar 2013 00:20:14 -0500 Subject: created entry point classes for the startup wizard and new item notifications --- MediaBrowser.ServerApplication/StartupWizard.cs | 61 +++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 MediaBrowser.ServerApplication/StartupWizard.cs (limited to 'MediaBrowser.ServerApplication/StartupWizard.cs') diff --git a/MediaBrowser.ServerApplication/StartupWizard.cs b/MediaBrowser.ServerApplication/StartupWizard.cs new file mode 100644 index 000000000..c5e8c1c99 --- /dev/null +++ b/MediaBrowser.ServerApplication/StartupWizard.cs @@ -0,0 +1,61 @@ +using MediaBrowser.Common.Kernel; +using MediaBrowser.Controller.Library; +using MediaBrowser.Controller.Plugins; +using System.Linq; + +namespace MediaBrowser.ServerApplication +{ + /// + /// Class StartupWizard + /// + public class StartupWizard : IServerEntryPoint + { + /// + /// The _app host + /// + private readonly IApplicationHost _appHost; + /// + /// The _user manager + /// + private readonly IUserManager _userManager; + + /// + /// Initializes a new instance of the class. + /// + /// The app host. + /// The user manager. + public StartupWizard(IApplicationHost appHost, IUserManager userManager) + { + _appHost = appHost; + _userManager = userManager; + } + + /// + /// Runs this instance. + /// + public void Run() + { + if (_appHost.IsFirstRun) + { + LaunchStartupWizard(); + } + } + + /// + /// Launches the startup wizard. + /// + private void LaunchStartupWizard() + { + var user = _userManager.Users.FirstOrDefault(u => u.Configuration.IsAdministrator); + + App.OpenDashboardPage("wizardStart.html", user); + } + + /// + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// + public void Dispose() + { + } + } +} -- cgit v1.2.3