private void LoadSettings()
{
using (Settings xmlreader = new MPSettings())
{
String channelName = xmlreader.GetValueAsString("radioguide", "channel", String.Empty);
TvBusinessLayer layer = new TvBusinessLayer();
IList<Channel> channels = layer.GetChannelsByName(channelName);
if (channels != null && channels.Count > 0)
{
_currentChannel = channels[0];
}
_cursorX = xmlreader.GetValueAsInt("radioguide", "ypos", 0);
ChannelOffset = xmlreader.GetValueAsInt("radioguide", "yoffset", 0);
_byIndex = xmlreader.GetValueAsBool("myradio", "byindex", true);
_showChannelNumber = xmlreader.GetValueAsBool("myradio", "showchannelnumber", false);
_channelNumberMaxLength = xmlreader.GetValueAsInt("myradio", "channelnumbermaxlength", 3);
_timePerBlock = xmlreader.GetValueAsInt("radioguide", "timeperblock", 30);
_hdtvProgramText = xmlreader.GetValueAsString("myradio", "hdtvProgramText", "(HDTV)");
_guideContinuousScroll = xmlreader.GetValueAsBool("myradio", "continuousScrollGuide", false);
_loopDelay = xmlreader.GetValueAsInt("gui", "listLoopDelay", 0);
}
// Load settings defined by the skin.
LoadSkinSettings();
// Load genre colors.
// If guide colors have not been loaded then attempt to load guide colors.
// this is just for the border highlight in radio EPG
if (!_guideColorsLoaded)
{
using (Settings xmlreader = new SKSettings())
{
_guideColorsLoaded = LoadGuideColors(xmlreader);
}
}
_useNewRecordingButtonColor =
Utils.FileExistsInCache(GUIGraphicsContext.GetThemedSkinFile(@"\media\tvguide_recButton_Focus_middle.png"));
_useNewPartialRecordingButtonColor =
Utils.FileExistsInCache(GUIGraphicsContext.GetThemedSkinFile(@"\media\tvguide_partRecButton_Focus_middle.png"));
_useNewNotifyButtonColor =
Utils.FileExistsInCache(GUIGraphicsContext.GetThemedSkinFile(@"\media\tvguide_notifyButton_Focus_middle.png"));
_useHdProgramIcon =
Utils.FileExistsInCache(GUIGraphicsContext.GetThemedSkinFile(@"\media\tvguide_hd_program.png"));
}