public TabWebMediaPortal() { InitializeComponent(); txtPort.Text = Configuration.WebMediaPortalHosting.Port.ToString(); txtHTTPSPort.Text = Configuration.WebMediaPortalHosting.PortTLS.ToString(); cbHTTPS.IsChecked = Configuration.WebMediaPortalHosting.EnableTLS; txtHTTPSPort.IsEnabled = Configuration.WebMediaPortalHosting.EnableTLS; sci = new ServiceControlInterface("MPExtended WebMediaPortal", lblStatusInfo, btnStartStop); if (sci.IsServiceAvailable) { sci.StartServiceWatcher(); } }
public MainWindow() { InitializeComponent(); Log.Debug("MPExtended configurator version {0} starting...", VersionUtil.GetFullVersionString()); SetupUSS(); if (StartupArguments.RunAsTrayApp && !StartupArguments.OpenOnStart) { Hide(); } HandleMediaPortalState(UserServices.USS.IsMediaPortalRunning()); // service control interface sci = new ServiceControlInterface("MPExtended Service", lblServiceState, btnStartStopService); if (!sci.IsServiceAvailable && Installation.GetFileLayoutType() == FileLayoutType.Installed) { Log.Error("MPExtended Service not installed"); MessageBox.Show(UI.ServiceNotInstalledPopup, "MPExtended", MessageBoxButton.OK, MessageBoxImage.Error); } else if (sci.IsServiceAvailable) { sci.StartServiceWatcher(); } // hide tabs and context menu items not applicable for current situation if (!Installation.IsServiceInstalled("MediaAccessService")) { tcMainTabs.Items.Remove(tiPlugin); tcMainTabs.Items.Remove(tiSocial); } if (!Installation.IsServiceInstalled("StreamingService")) { tcMainTabs.Items.Remove(tiStreaming); tcMainTabs.Items.Remove(tiSocial); } if (!Installation.IsProductInstalled(MPExtendedProduct.WebMediaPortal)) { tcMainTabs.Items.Remove(tiWebMediaPortal); taskbarItemContextMenu.Items.Remove(MenuOpenWebMP); } // initialize some tabs Pages.TabConfiguration.StartLoadingTranslations(); }