private void SongTimer_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (ClosingBool == false) { try { label1.Invoke((MethodInvoker) delegate { string TempString = label1.Text; label1.Text = "Now Playing" + Environment.NewLine + madHax.SongInformation(); if (label1.Text != TempString && checkBox1.Checked == true) { ToastNotification(); } }); if (ManualMode == false) { SongTimer.RunWorkerAsync(); } } catch {} } }
private void Form1_Load(object sender, EventArgs e) { madHax.GUIConsoleWriter(); madHax.readIP(); var parser = new FileIniDataParser(); IniData data = parser.ReadFile("Configuration.ini"); #region Station Buttons station1.Text = madHax.dynStationName(1); station2.Text = madHax.dynStationName(2); station3.Text = madHax.dynStationName(3); station4.Text = madHax.dynStationName(4); station5.Text = madHax.dynStationName(5); station6.Text = madHax.dynStationName(6); station7.Text = madHax.dynStationName(7); station8.Text = madHax.dynStationName(8); station9.Text = madHax.dynStationName(9); station10.Text = madHax.dynStationName(10); #region Station Button ToolTips toolTip1.SetToolTip(station1, madHax.dynStationTip(1)); toolTip1.SetToolTip(station2, madHax.dynStationTip(2)); toolTip1.SetToolTip(station3, madHax.dynStationTip(3)); toolTip1.SetToolTip(station4, madHax.dynStationTip(4)); toolTip1.SetToolTip(station5, madHax.dynStationTip(5)); toolTip1.SetToolTip(station6, madHax.dynStationTip(6)); toolTip1.SetToolTip(station7, madHax.dynStationTip(7)); toolTip1.SetToolTip(station8, madHax.dynStationTip(8)); toolTip1.SetToolTip(station9, madHax.dynStationTip(9)); toolTip1.SetToolTip(station10, madHax.dynStationTip(10)); #endregion Station Button ToolTips #endregion Station Buttons #region MiniPlayer Color try { checkBox1.Checked = Convert.ToBoolean(data["Config"]["Notifications"]); } catch { checkBox1.Checked = false; } foreach (PropertyInfo prop in typeof(Color).GetProperties()) { if (prop.PropertyType.FullName == "System.Drawing.Color") { comboBox1.Items.Add(prop.Name); } } if (comboBox1.Items.Contains(data["Config"]["MiniPlayerColor"]) == true) { comboBox1.SelectedItem = data["Config"]["MiniPlayerColor"]; } else if (comboBox1.Items.Contains(data["Config"]["MiniPlayerColor"]) == true || data["Config"]["MiniPlayerColor"] == "" || data["Config"]["MiniPlayerColor"] == null) { comboBox1.SelectedItem = "White"; data["Config"]["MiniPlayerColor"] = "White"; parser.WriteFile("Configuration.ini", data); } #endregion label1.Text = "Now Playing" + Environment.NewLine + madHax.SongInformation(); SongTimer.RunWorkerAsync(); }