/// <summary> /// Initializes a new instance of the <see cref="MainWindow" /> class. /// </summary> /// <param name="logManager">The log manager.</param> /// <param name="appHost">The app host.</param> /// <param name="configurationManager">The configuration manager.</param> /// <param name="userManager">The user manager.</param> /// <param name="libraryManager">The library manager.</param> /// <param name="jsonSerializer">The json serializer.</param> /// <param name="displayPreferencesManager">The display preferences manager.</param> /// <exception cref="System.ArgumentNullException">logger</exception> public MainWindow(ILogManager logManager, IServerApplicationHost appHost, IServerConfigurationManager configurationManager, IUserManager userManager, ILibraryManager libraryManager, IJsonSerializer jsonSerializer, IDisplayPreferencesRepository displayPreferencesManager) { if (logManager == null) { throw new ArgumentNullException("logManager"); } if (appHost == null) { throw new ArgumentNullException("appHost"); } if (configurationManager == null) { throw new ArgumentNullException("configurationManager"); } _logger = logManager.GetLogger("MainWindow"); _appHost = appHost; _logManager = logManager; _configurationManager = configurationManager; _userManager = userManager; _libraryManager = libraryManager; _jsonSerializer = jsonSerializer; _displayPreferencesManager = displayPreferencesManager; InitializeComponent(); Loaded += MainWindowLoaded; }
/// <summary> /// Initializes a new instance of the <see cref="DisplayPreferencesService" /> class. /// </summary> /// <param name="jsonSerializer">The json serializer.</param> /// <param name="displayPreferencesManager">The display preferences manager.</param> public DisplayPreferencesService( ILogger <DisplayPreferencesService> logger, IServerConfigurationManager serverConfigurationManager, IHttpResultFactory httpResultFactory, IJsonSerializer jsonSerializer, IDisplayPreferencesRepository displayPreferencesManager) : base(logger, serverConfigurationManager, httpResultFactory) { _jsonSerializer = jsonSerializer; _displayPreferencesManager = displayPreferencesManager; }
/// <summary> /// Initializes a new instance of the <see cref="LibraryExplorer" /> class. /// </summary> /// <param name="jsonSerializer">The json serializer.</param> /// <param name="logger">The logger.</param> /// <param name="appHost">The app host.</param> /// <param name="userManager">The user manager.</param> /// <param name="libraryManager">The library manager.</param> /// <param name="displayPreferencesManager">The display preferences manager.</param> public LibraryExplorer(IJsonSerializer jsonSerializer, ILogger logger, IApplicationHost appHost, IUserManager userManager, ILibraryManager libraryManager, IDisplayPreferencesRepository displayPreferencesManager) { _logger = logger; _jsonSerializer = jsonSerializer; _libraryManager = libraryManager; _displayPreferencesManager = displayPreferencesManager; InitializeComponent(); lblVersion.Content = "Version: " + appHost.ApplicationVersion; foreach (var user in userManager.Users) { ddlProfile.Items.Add(user); } ddlProfile.Items.Insert(0, new User { Name = "Physical" }); ddlProfile.SelectedIndex = 0; ddlIndexBy.Visibility = ddlSortBy.Visibility = lblIndexBy.Visibility = lblSortBy.Visibility = Visibility.Hidden; }
public LibraryViewer(IJsonSerializer jsonSerializer, IUserManager userManager, ILibraryManager libraryManager, IDisplayPreferencesRepository displayPreferencesManager, IItemRepository itemRepo) { InitializeComponent(); _jsonSerializer = jsonSerializer; _libraryManager = libraryManager; _displayPreferencesManager = displayPreferencesManager; _itemRepository = itemRepo; foreach (var user in userManager.Users) { selectUser.Items.Add(user); } selectUser.Items.Insert(0, new User { Name = "Physical" }); selectUser.SelectedIndex = 0; selectUser.SelectedIndexChanged += selectUser_SelectedIndexChanged; treeView1.AfterSelect += treeView1_AfterSelect; }
/// <summary> /// Initializes a new instance of the <see cref="DisplayPreferencesService" /> class. /// </summary> /// <param name="jsonSerializer">The json serializer.</param> /// <param name="displayPreferencesManager">The display preferences manager.</param> public DisplayPreferencesService(IJsonSerializer jsonSerializer, IDisplayPreferencesRepository displayPreferencesManager) { _jsonSerializer = jsonSerializer; _displayPreferencesManager = displayPreferencesManager; }
public ServerNotifyIcon(ILogManager logManager, IServerApplicationHost appHost, IServerConfigurationManager configurationManager, IUserManager userManager, ILibraryManager libraryManager, IJsonSerializer jsonSerializer, IDisplayPreferencesRepository displayPreferencesManager, IItemRepository itemRepo, ILocalizationManager localization) { _logger = logManager.GetLogger("MainWindow"); _itemRepository = itemRepo; _localization = localization; _appHost = appHost; _logManager = logManager; _configurationManager = configurationManager; _userManager = userManager; _libraryManager = libraryManager; _jsonSerializer = jsonSerializer; _displayPreferencesManager = displayPreferencesManager; var components = new System.ComponentModel.Container(); var resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(components); notifyIcon1 = new System.Windows.Forms.NotifyIcon(components); cmdExit = new System.Windows.Forms.ToolStripMenuItem(); cmdCommunity = new System.Windows.Forms.ToolStripMenuItem(); cmdLogWindow = new System.Windows.Forms.ToolStripMenuItem(); toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); cmdRestart = new System.Windows.Forms.ToolStripMenuItem(); cmdLibraryExplorer = new System.Windows.Forms.ToolStripMenuItem(); toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); cmdConfigure = new System.Windows.Forms.ToolStripMenuItem(); cmdBrowse = new System.Windows.Forms.ToolStripMenuItem(); cmdApiDocs = new System.Windows.Forms.ToolStripMenuItem(); cmdStandardDocs = new System.Windows.Forms.ToolStripMenuItem(); cmdSwagger = new System.Windows.Forms.ToolStripMenuItem(); cmdGtihub = new System.Windows.Forms.ToolStripMenuItem(); // // notifyIcon1 // notifyIcon1.ContextMenuStrip = contextMenuStrip1; notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon"))); notifyIcon1.Text = "Media Browser"; notifyIcon1.Visible = true; // // contextMenuStrip1 // contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { cmdBrowse, cmdConfigure, toolStripSeparator2, cmdLibraryExplorer, cmdRestart, toolStripSeparator1, cmdApiDocs, cmdLogWindow, cmdCommunity, cmdExit}); contextMenuStrip1.Name = "contextMenuStrip1"; contextMenuStrip1.ShowCheckMargin = true; contextMenuStrip1.ShowImageMargin = false; contextMenuStrip1.Size = new System.Drawing.Size(209, 214); // // cmdExit // cmdExit.Name = "cmdExit"; cmdExit.Size = new System.Drawing.Size(208, 22); // // cmdCommunity // cmdCommunity.Name = "cmdCommunity"; cmdCommunity.Size = new System.Drawing.Size(208, 22); // // cmdLogWindow // cmdLogWindow.CheckOnClick = true; cmdLogWindow.Name = "cmdLogWindow"; cmdLogWindow.Size = new System.Drawing.Size(208, 22); // // toolStripSeparator1 // toolStripSeparator1.Name = "toolStripSeparator1"; toolStripSeparator1.Size = new System.Drawing.Size(205, 6); // // cmdRestart // cmdRestart.Name = "cmdRestart"; cmdRestart.Size = new System.Drawing.Size(208, 22); // // cmdLibraryExplorer // cmdLibraryExplorer.Name = "cmdLibraryExplorer"; cmdLibraryExplorer.Size = new System.Drawing.Size(208, 22); // // toolStripSeparator2 // toolStripSeparator2.Name = "toolStripSeparator2"; toolStripSeparator2.Size = new System.Drawing.Size(205, 6); // // cmdConfigure // cmdConfigure.Name = "cmdConfigure"; cmdConfigure.Size = new System.Drawing.Size(208, 22); // // cmdBrowse // cmdBrowse.Name = "cmdBrowse"; cmdBrowse.Size = new System.Drawing.Size(208, 22); // // cmdApiDocs // cmdApiDocs.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { cmdStandardDocs, cmdSwagger, cmdGtihub}); cmdApiDocs.Name = "cmdApiDocs"; cmdApiDocs.Size = new System.Drawing.Size(208, 22); // // cmdStandardDocs // cmdStandardDocs.Name = "cmdStandardDocs"; cmdStandardDocs.Size = new System.Drawing.Size(136, 22); // // cmdSwagger // cmdSwagger.Name = "cmdSwagger"; cmdSwagger.Size = new System.Drawing.Size(136, 22); // // cmdGtihub // cmdGtihub.Name = "cmdGtihub"; cmdGtihub.Size = new System.Drawing.Size(136, 22); cmdExit.Click += cmdExit_Click; cmdRestart.Click += cmdRestart_Click; cmdLogWindow.Click += cmdLogWindow_Click; cmdConfigure.Click += cmdConfigure_Click; cmdCommunity.Click += cmdCommunity_Click; cmdBrowse.Click += cmdBrowse_Click; cmdLibraryExplorer.Click += cmdLibraryExplorer_Click; cmdSwagger.Click += cmdSwagger_Click; cmdStandardDocs.Click += cmdStandardDocs_Click; cmdGtihub.Click += cmdGtihub_Click; LoadLogWindow(null, EventArgs.Empty); _logManager.LoggerLoaded += LoadLogWindow; _configurationManager.ConfigurationUpdated += Instance_ConfigurationUpdated; LocalizeText(); if (_appHost.IsFirstRun) { Action action = () => notifyIcon1.ShowBalloonTip(5000, "Media Browser", "Welcome to Media Browser Server!", ToolTipIcon.Info); contextMenuStrip1.Invoke(action); } }
public ServerNotifyIcon(ILogManager logManager, IServerApplicationHost appHost, IServerConfigurationManager configurationManager, IUserManager userManager, ILibraryManager libraryManager, IJsonSerializer jsonSerializer, IDisplayPreferencesRepository displayPreferencesManager, IItemRepository itemRepo) { _logger = logManager.GetLogger("MainWindow"); _itemRepository = itemRepo; _appHost = appHost; _logManager = logManager; _configurationManager = configurationManager; _userManager = userManager; _libraryManager = libraryManager; _jsonSerializer = jsonSerializer; _displayPreferencesManager = displayPreferencesManager; var components = new System.ComponentModel.Container(); var resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(components); notifyIcon1 = new System.Windows.Forms.NotifyIcon(components); cmdExit = new System.Windows.Forms.ToolStripMenuItem(); cmdCommunity = new System.Windows.Forms.ToolStripMenuItem(); cmdLogWindow = new System.Windows.Forms.ToolStripMenuItem(); toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); cmdRestart = new System.Windows.Forms.ToolStripMenuItem(); cmdLibraryExplorer = new System.Windows.Forms.ToolStripMenuItem(); toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); cmdConfigure = new System.Windows.Forms.ToolStripMenuItem(); cmdBrowse = new System.Windows.Forms.ToolStripMenuItem(); cmdApiDocs = new System.Windows.Forms.ToolStripMenuItem(); cmdStandardDocs = new System.Windows.Forms.ToolStripMenuItem(); cmdSwagger = new System.Windows.Forms.ToolStripMenuItem(); cmdGtihub = new System.Windows.Forms.ToolStripMenuItem(); // // notifyIcon1 // notifyIcon1.ContextMenuStrip = contextMenuStrip1; notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon"))); notifyIcon1.Text = "Media Browser"; notifyIcon1.Visible = true; // // contextMenuStrip1 // contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { cmdBrowse, cmdConfigure, toolStripSeparator2, cmdLibraryExplorer, cmdRestart, toolStripSeparator1, cmdApiDocs, cmdLogWindow, cmdCommunity, cmdExit }); contextMenuStrip1.Name = "contextMenuStrip1"; contextMenuStrip1.ShowCheckMargin = true; contextMenuStrip1.ShowImageMargin = false; contextMenuStrip1.Size = new System.Drawing.Size(209, 214); // // cmdExit // cmdExit.Name = "cmdExit"; cmdExit.Size = new System.Drawing.Size(208, 22); cmdExit.Text = "Exit"; // // cmdCommunity // cmdCommunity.Name = "cmdCommunity"; cmdCommunity.Size = new System.Drawing.Size(208, 22); cmdCommunity.Text = "Visit Community"; // // cmdLogWindow // cmdLogWindow.CheckOnClick = true; cmdLogWindow.Name = "cmdLogWindow"; cmdLogWindow.Size = new System.Drawing.Size(208, 22); cmdLogWindow.Text = "Show Log Window"; // // toolStripSeparator1 // toolStripSeparator1.Name = "toolStripSeparator1"; toolStripSeparator1.Size = new System.Drawing.Size(205, 6); // // cmdRestart // cmdRestart.Name = "cmdRestart"; cmdRestart.Size = new System.Drawing.Size(208, 22); cmdRestart.Text = "Restart Server"; // // cmdLibraryExplorer // cmdLibraryExplorer.Name = "cmdLibraryExplorer"; cmdLibraryExplorer.Size = new System.Drawing.Size(208, 22); cmdLibraryExplorer.Text = "Open Library Explorer"; // // toolStripSeparator2 // toolStripSeparator2.Name = "toolStripSeparator2"; toolStripSeparator2.Size = new System.Drawing.Size(205, 6); // // cmdConfigure // cmdConfigure.Name = "cmdConfigure"; cmdConfigure.Size = new System.Drawing.Size(208, 22); cmdConfigure.Text = "Configure Media Browser"; // // cmdBrowse // cmdBrowse.Name = "cmdBrowse"; cmdBrowse.Size = new System.Drawing.Size(208, 22); cmdBrowse.Text = "Browse Library"; // // cmdApiDocs // cmdApiDocs.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { cmdStandardDocs, cmdSwagger, cmdGtihub }); cmdApiDocs.Name = "cmdApiDocs"; cmdApiDocs.Size = new System.Drawing.Size(208, 22); cmdApiDocs.Text = "View Api Documentation"; // // cmdStandardDocs // cmdStandardDocs.Name = "cmdStandardDocs"; cmdStandardDocs.Size = new System.Drawing.Size(136, 22); cmdStandardDocs.Text = "Standard"; // // cmdSwagger // cmdSwagger.Name = "cmdSwagger"; cmdSwagger.Size = new System.Drawing.Size(136, 22); cmdSwagger.Text = "Swagger"; // // cmdGtihub // cmdGtihub.Name = "cmdGtihub"; cmdGtihub.Size = new System.Drawing.Size(136, 22); cmdGtihub.Text = "Github Wiki"; cmdExit.Click += cmdExit_Click; cmdRestart.Click += cmdRestart_Click; cmdLogWindow.Click += cmdLogWindow_Click; cmdConfigure.Click += cmdConfigure_Click; cmdCommunity.Click += cmdCommunity_Click; cmdBrowse.Click += cmdBrowse_Click; cmdLibraryExplorer.Click += cmdLibraryExplorer_Click; cmdSwagger.Click += cmdSwagger_Click; cmdStandardDocs.Click += cmdStandardDocs_Click; cmdGtihub.Click += cmdGtihub_Click; LoadLogWindow(null, EventArgs.Empty); _logManager.LoggerLoaded += LoadLogWindow; _configurationManager.ConfigurationUpdated += Instance_ConfigurationUpdated; if (_appHost.IsFirstRun) { Action action = () => notifyIcon1.ShowBalloonTip(5000, "Media Browser", "Welcome to Media Browser Server!", ToolTipIcon.Info); contextMenuStrip1.Invoke(action); } }