本文整理汇总了C#中MPSettings.HasSection方法的典型用法代码示例。如果您正苦于以下问题:C# MPSettings.HasSection方法的具体用法?C# MPSettings.HasSection怎么用?C# MPSettings.HasSection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MPSettings
的用法示例。
在下文中一共展示了MPSettings.HasSection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadSettings
public override void LoadSettings()
{
//Load parameters from XML File
using (Settings xmlreader = new MPSettings())
{
mpTextBoxHostname.Text = xmlreader.GetValueAsString("tvservice", "hostname", "");
mpCheckBoxPrefAC3.Checked = xmlreader.GetValueAsBool("tvservice", "preferac3", false);
mpCheckBoxPrefAudioOverLang.Checked = xmlreader.GetValueAsBool("tvservice", "preferAudioTypeOverLang", true);
_preferredAudioLanguages = xmlreader.GetValueAsString("tvservice", "preferredaudiolanguages", "");
_preferredSubLanguages = xmlreader.GetValueAsString("tvservice", "preferredsublanguages", "");
mpCheckBoxEnableDVBSub.Checked = xmlreader.GetValueAsBool("tvservice", "dvbbitmapsubtitles", false);
mpCheckBoxEnableTTXTSub.Checked = xmlreader.GetValueAsBool("tvservice", "dvbttxtsubtitles", false);
mpCheckBoxEnableCCSub.Checked = xmlreader.GetValueAsBool("tvservice", "ccsubtitles", false);
mpCheckBoxAutoShowSubWhenTvStarts.Checked = xmlreader.GetValueAsBool("tvservice", "autoshowsubwhentvstarts", true);
enableAudioDualMonoModes.Checked = xmlreader.GetValueAsBool("tvservice", "audiodualmono", false);
cbHideAllChannels.Checked = xmlreader.GetValueAsBool("mytv", "hideAllChannelsGroup", false);
cbShowChannelStateIcons.Checked = xmlreader.GetValueAsBool("mytv", "showChannelStateIcons", true);
cbContinuousScrollGuide.Checked = xmlreader.GetValueAsBool("mytv", "continuousScrollGuide", false);
cbRelaxTsReader.Checked = xmlreader.GetValueAsBool("mytv", "relaxTsReader", false);
mpCheckBoxIsWakeOnLanEnabled.Checked = xmlreader.GetValueAsBool("tvservice", "isWakeOnLanEnabled", false);
mpNumericTextBoxWOLTimeOut.Text = xmlreader.GetValueAsString("tvservice", "WOLTimeOut", "10");
mpCheckBoxIsAutoMacAddressEnabled.Checked = xmlreader.GetValueAsBool("tvservice", "isAutoMacAddressEnabled",
true);
mpTextBoxMacAddress.Text = xmlreader.GetValueAsString("tvservice", "macAddress", "00:00:00:00:00:00");
mpCheckBoxRatingAsMovie.Checked = xmlreader.GetValueAsBool("genreoptions", "specifympaaratedasmovie", true);
chkRecnotifications.Checked = xmlreader.GetValueAsBool("mytv", "enableRecNotifier", false);
txtNotifyBefore.Text = xmlreader.GetValueAsString("mytv", "notifyTVBefore", "300");
txtNotifyAfter.Text = xmlreader.GetValueAsString("mytv", "notifyTVTimeout", "15");
checkBoxNotifyPlaySound.Checked = xmlreader.GetValueAsBool("mytv", "notifybeep", true);
int showEpisodeinfo = xmlreader.GetValueAsInt("mytv", "showEpisodeInfo", 0);
if (showEpisodeinfo > this.ShowEpisodeOptions.Length)
{
showEpisodeinfo = 0;
}
comboboxShowEpisodeInfo.SelectedIndex = showEpisodeinfo;
}
// Populate the list of program genres from the tv database.
Assembly assem = Assembly.LoadFrom(Config.GetFolder(Config.Dir.Base) + "\\TvControl.dll");
if (assem != null)
{
Type[] types = assem.GetExportedTypes();
foreach (Type exportedType in types)
{
try
{
if (exportedType.Name == "TvServer")
{
Object genreObject = null;
genreObject = Activator.CreateInstance(exportedType);
MethodInfo methodInfo = exportedType.GetMethod("GetGenres", BindingFlags.Public | BindingFlags.Instance);
_allProgramGenres = methodInfo.Invoke(genreObject, null) as List<String>;
using (Settings xmlreader = new MPSettings())
{
// If the genre map does not contain any entries then we'll create an initial default map.
if (!xmlreader.HasSection<string>("genremap"))
{
CreateDefaultGenres(xmlreader);
}
// Load the genre map from MP settings.
if (_genreMap.Count == 0)
{
LoadGenreMap(xmlreader);
}
if (!xmlreader.HasSection<string>("genreoptions"))
{
xmlreader.SetValueAsBool("genreoptions", "specifympaaratedasmovie", true); // Rated programs are movies
}
// Populate the guide genre list with names.
PopulateGuideGenreList();
}
}
}
catch (TargetInvocationException ex)
{
Log.Warn("TVClient: Failed to load genres {0}", ex.ToString());
continue;
}
catch (Exception gex)
{
Log.Warn("TVClient: Failed to load settings {0}", gex.Message);
}
}
}
mpCheckBoxIsWakeOnLanEnabled_CheckedChanged(null, null);
// Enable this Panel if the TvPlugin exists in the plug-in Directory
Enabled = true;
try
{
assem = Assembly.LoadFrom(Config.GetFolder(Config.Dir.Base) + "\\TvLibrary.Interfaces.dll");
//.........这里部分代码省略.........