private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            //如果为empty。..焦点..
            if (IsEmpty(txtRadioName) )
            {
                return;
            }
            if (IsEmpty(txtRadioUri))
            {
                return;
            }
            if (IsEmpty(txtRadioType))
            {
                return;
            }

            if (OnButtonOKClickChanged!=null)
            {

                //radioname = txtRadioName.Text;
                //radiouri = txtRadioUri.Text;
                //radiotype = txtRadioType.Text;
                RadioContent radio = new RadioContent();
                radio.RadioName = txtRadioName.Text;
                radio.RadioURL = txtRadioUri.Text;
                radio.Type = txtRadioType.Text;

                OnButtonOKClickChanged(this, new InputControlEventArgs() { radio = radio });
            }
            this.CloseMeAsPopup();
        }
 public List <RadioStation> this[RadioContent contentGenre]
 {
     get
     {
         return(stations.FindAll(s => s.Content == contentGenre).OrderByDescending(f => f.Freqeuncy).ToList());
     }
 }
Exemple #3
0
 public static List<RadioContent> GetSuggestRadios()
 {
     List<RadioContent> _radios = new List<RadioContent>();
        StreamResourceInfo resource = App.GetResourceStream(new Uri("Resources/suggest.txt", UriKind.Relative));
        StreamReader sr = new StreamReader(resource.Stream);
        string line = sr.ReadLine();
        while (!string.IsNullOrWhiteSpace(line))
        {
        var ary = line.Split('$');
        var radioInfo = new RadioContent { RadioName = ary[0], RadioURL = ary[1], Type = ary[2] };
        _radios.Add(radioInfo);
        line = sr.ReadLine();
        }
        return _radios;
 }
Exemple #4
0
 public RadioStation(string setStationName, RadioContent setContent, double setFrequency)
 {
     RStation  = setStationName;
     Content   = setContent;
     Freqeuncy = setFrequency;
 }