/// <summary> /// Stop WCF Server /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void stoppedToolStripMenuItem_Click(object sender, EventArgs e) { if (WWWinampServiceHost.StopService()) { toolStripSplitButton1.Image = Functions.ReadEmbeddedResourceToBitmap("Critical.bmp"); toolStripSplitButton1.ToolTipText = "Service Stopped"; } }
private void Form1_Load(object sender, EventArgs e) { try { //Set Program Title this.Text = AppConfiguration.configProgramName + " " + AppConfiguration.configProgramVersion + " Server"; //Set System Tray ToolTip Title notifyIcon1.Text = AppConfiguration.configProgramName + " " + AppConfiguration.configProgramVersion; //Set Default Status for Services WebServer.ListeningStatus = WebServer.Status.Stopped; //Check OS Compatability and Warn user about data files in Vista if (Environment.OSVersion.Version.Major >= 6) { LogHandler.LogEvent("!!"); LogHandler.LogEvent("!! WWWinamp has detected you are using Windows Vista (or newer)"); LogHandler.LogEvent("!! Please be aware that Windows Vista does not allow writing to the Program Files folder"); LogHandler.LogEvent("!! and that you must change the \"Winamp Directory\" value in WWWINAMP.XML to the correct"); LogHandler.LogEvent("!! folder which contains the \"Roaming\" Application data. This folder is commonly:"); LogHandler.LogEvent(@"!! C:\Users\<USER NAME>\AppData\Roaming\Winamp\"); LogHandler.LogEvent("!! If you do not do this, the Playlist will not generate correctly. Thanks!"); LogHandler.LogEvent("!!"); } //Get WinAMP Handles LogHandler.LogEvent("Retrieving WinAMP Handles..."); if (!WinAmpController.GetWinampHandles()) { return; } //Build Media Library LogHandler.LogEvent("Building Media Library..."); //Call Build Thread Thread thBuildMediaLibrary = new Thread(new ThreadStart(LibraryController.BuildMediaLibrary)); thBuildMediaLibrary.Start(); //Start HTTP Daemon if Specified if (AppConfiguration.configWWWinampStartHTTP) { WebServer.ListeningIP = AppConfiguration.configWWWinampHTTPListeningIP; WebServer.ListeningPort = AppConfiguration.configWWWinampHTTPListeningPort; if (WebServer.StartListener()) { toolStripSplitButton2.Image = Functions.ReadEmbeddedResourceToBitmap("OK.bmp"); } } //Start WCF Daemon if Specified if (AppConfiguration.configWWWinampStartWCF) { WWWinampServiceHost.StartService(); toolStripSplitButton1.Image = Functions.ReadEmbeddedResourceToBitmap("OK.bmp"); } } catch (Exception eException) { LogHandler.LogError(eException); } }