//88888 // public Service1(object caller) public Service1() { InitializeComponent(); //88888 theController = new ThreadController(this); // theController = new ThreadController(); }
// Constructor //88888 public RPController(object caller) { controller = new ThreadController(caller); // public RPController() // { // controller = new ThreadController(); controller.IsRunningChanged += new EventHandler(controller_IsRunningChanged); }
// Constructor //88888 public RPController(object caller) { controller = new ThreadController(caller); // public RPController() // { // controller = new ThreadController(); controller.IsRunningChanged += new EventHandler(controller_IsRunningChanged); }
// Constructor public RPController() { controller = new ThreadController(); controller.IsRunningChanged += new EventHandler(controller_IsRunningChanged); }
void StartWebServer(bool startAsService) { if (ServerIsRunning) { RPMessageBox.ShowAlert("Cannot start server as it is already running."); return; // already running } // Can we start? if (!ValidateSecuritySettings()) { btnToggleServer.Enabled = true; return; // failed validation } if (WarnIfLegacyAppRunning()) { btnToggleServer.Enabled = true; return; // failed - legacy app is running } // Offer windows firewall? OfferToAddFirewallRulesIfNotAlreadyOffered(); // No URL reserved - ask first... (then try to start server again) if ( (Settings.Default.LastSetSecurityForPort != Settings.Default.Port)) { ReserveURLForPort(true); return; } // Dispose any local process if (webserverTC != null) { webserverTC.IsRunningChanged -= new EventHandler(serverTC_IsRunningChanged); webserverTC = null; } // RUN! if ((startAsService) && (ServerRunningType == ServerRunningTypes.ServiceStopped)) // Service must be installed! { if (!ServiceManager.StartRemotePotatoService()) // sync, returns false if didn't work (event will fire when status changes to update display etc.) { btnToggleServer.Enabled = true; RPMessageBox.ShowAlert("Could not start the Remote Potato service.\r\nCheck that you have entered the correct account name and password in the 'Music Library' tab.\r\n\r\nAlternatively, please try re-installing Remote Potato to rectify this issue."); } } else { webserverTC = new ThreadController(); // Create controller for webserver webserverTC.IsRunningChanged += new EventHandler(serverTC_IsRunningChanged); webserverTC.Start(); } }
// Constructor public RPController() { controller = new ThreadController(); controller.IsRunningChanged += new EventHandler(controller_IsRunningChanged); }
public Service1() { InitializeComponent(); theController = new ThreadController(); }