Example #1
0
        /// <summary>
        /// reverses a radio station's favourite state
        /// </summary>
        /// <param name="radioInfo"></param>
        public void UpdateFavState(RadioInfo radioInfo)
        {
            RadioInfo radioInfo1 = _radioInfos.FirstOrDefault(r => r == radioInfo);

            if (radioInfo1 != null)
            {
                radioInfo1.Faved = !radioInfo1.Faved;
                WriteDataToFile();
            }
        }
Example #2
0
        private void SaveBtn_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(TitleEdit.Text))
            {
                MessageBox.Show("Radio title cannot be empty.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (String.IsNullOrEmpty(StreamUrlEdit.Text))
            {
                MessageBox.Show("Stream url cannot be empty.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            RadioInfo radioInfo = new RadioInfo()
            {
                Title = TitleEdit.Text,
                CategoryId = CategoryList.SelectedIndex+1,
                HomePage = HomeEdit.Text,
                StreamUrl = StreamUrlEdit.Text,
                Active = true,
                Faved = false
            };

            _radioDb.Add(radioInfo);
            this.Close();
        }
Example #3
0
 /// <summary>
 /// adds a single radio station to the list
 /// </summary>
 /// <param name="radioInfo">radio station</param>
 public void Add(RadioInfo radioInfo)
 {
     _radioInfos.Add(radioInfo);
     WriteDataToFile();
 }
Example #4
0
 /// <summary>
 /// adds a single radio station to the list
 /// </summary>
 /// <param name="radioInfo">radio station</param>
 public void Add(RadioInfo radioInfo)
 {
     _radioInfos.Add(radioInfo);
     WriteDataToFile();
 }