static bool TryParse(string[] values, CultureInfo culture, out RadioStationSchedule.Slot slot)
        {
            slot = null;

            if (Enum.TryParse <DayOfWeek>(values[0], out var dow))
            {
                if (TimeSpan.TryParseExact(values[1], "h\\:mm", culture, out var tod))
                {
                    var url      = values.Length >= 5 ? values[4] : null;
                    var imageUrl = values.Length >= 6 ? values[5] : null;

                    slot = new RadioStationSchedule.Slot(dow, tod, values[3], values[2], url, imageUrl);
                }
                else
                {
                    Log.Warn(TAG, $"Invalid TimeOfDay '{values[1]}'; the row will be skipped");
                }
            }
            else
            {
                Log.Warn(TAG, $"Invalid DayOfWeek '{values[0]}'; the row will be skipped");
            }

            return(slot != null);
        }
Ejemplo n.º 2
0
 public RadioStationNowPlaying(RadioStationSchedule.Slot slot, DateTimeOffset start, TimeSpan duration, Android.Graphics.Bitmap cover)
 {
     Slot     = slot;
     _start   = start;
     Duration = duration;
     Cover    = cover;
 }