本文整理汇总了C#中Settings.SetValueAsBool方法的典型用法代码示例。如果您正苦于以下问题:C# Settings.SetValueAsBool方法的具体用法?C# Settings.SetValueAsBool怎么用?C# Settings.SetValueAsBool使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Settings
的用法示例。
在下文中一共展示了Settings.SetValueAsBool方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: fncSaveConfig
private void fncSaveConfig()
{
Settings mpSettings = new Settings(MediaPortal.Configuration.Config.GetFolder(MediaPortal.Configuration.Config.Dir.Config) + @"\mpNZB.xml");
// Plugin Settings
// ##################################################
int intUpdateFreq = 1;
int.TryParse(txtUpdateFreq.Text, out intUpdateFreq);
if (intUpdateFreq < 1) { intUpdateFreq = 1; }
mpSettings.SetValue("#Plugin", "UpdateFrequency", intUpdateFreq);
mpSettings.SetValue("#Plugin", "DisplayName", txtDisplayName.Text);
mpSettings.SetValueAsBool("#Plugin", "Notifications", chkNotifications.Checked);
int intAutohide = (int)numericUpDownAutoHide.Value;
mpSettings.SetValue("#Plugin", "AutoHideSeconds", intAutohide);
// ##################################################
// Client Settings
// ##################################################
mpSettings.SetValue("#Client", "Grabber", cmbGrabber.Text);
mpSettings.SetValue("#Client", "Host", txtHost.Text);
mpSettings.SetValue("#Client", "Port", txtPort.Text);
mpSettings.SetValueAsBool("#Client", "Https", checkBoxHttps.Checked);
mpSettings.SetValueAsBool("#Client", "CatSelect", chkCatSelect.Checked);
mpSettings.SetValueAsBool("#Client", "Auth", chkAuth.Checked);
mpSettings.SetValue("#Client", "Username", txtUsername.Text);
mpSettings.SetValue("#Client", "Password", txtPassword.Text);
mpSettings.SetValue("#Client", "APIKey", txtAPIKey.Text);
// ##################################################
// Site Settings
// ##################################################
int intMaxResults = 50;
int.TryParse(txtMaxResults.Text, out intMaxResults);
mpSettings.SetValue("#Sites", "MaxResults", intMaxResults);
mpSettings.SetValueAsBool("#Sites", "MPTVSeries", chkMPTVSeries.Checked);
// ##################################################
// Searches
// ##################################################
foreach (ListViewItem Item in lvSearches.Items)
{
mpSettings.SetValue("#Searches", Item.SubItems[0].Text, Item.SubItems[1].Text);
}
// ##################################################
// Groups
// ##################################################
foreach (ListViewItem Item in lvGroups.Items)
{
mpSettings.SetValue("#Groups", Item.Text, String.Empty);
}
// ##################################################
mpSettings.Dispose();
}
示例2: SaveSettings
/// <summary>
/// Saves the settings.
/// </summary>
private static void SaveSettings()
{
try
{
using (Settings xmlwriter = new Settings(MPCommon.MPConfigFile))
{
xmlwriter.SetValue("MPControlPlugin", "ServerHost", ServerHost);
xmlwriter.SetValueAsBool("MPControlPlugin", "RequireFocus", RequireFocus);
xmlwriter.SetValueAsBool("MPControlPlugin", "MultiMappingEnabled", MultiMappingEnabled);
xmlwriter.SetValue("MPControlPlugin", "MultiMappingButton", (int) MultiMappingButton);
xmlwriter.SetValueAsBool("MPControlPlugin", "EventMapperEnabled", EventMapperEnabled);
xmlwriter.SetValue("MPControlPlugin", "MouseModeButton", (int) MouseModeButton);
xmlwriter.SetValueAsBool("MPControlPlugin", "MouseModeEnabled", MouseModeEnabled);
xmlwriter.SetValue("MPControlPlugin", "MouseModeStep", MouseModeStep);
xmlwriter.SetValueAsBool("MPControlPlugin", "MouseModeAcceleration", MouseModeAcceleration);
}
}
catch (Exception ex)
{
Log.Error(ex);
}
}
示例3: SaveSettings
/// <summary>
/// Store the settings, if the user wants it
/// </summary>
protected void SaveSettings()
{
if (_rememberLastValues)
{
using (Settings xmlreader = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
{
xmlreader.SetValueAsBool("mytv", "teletextHidden", _hiddenMode);
xmlreader.SetValueAsBool("mytv", "teletextTransparent", _transparentMode);
}
}
}
示例4: SaveSettings
public void SaveSettings(string ExportFileName)
{
string tmpConfigFileName = Config.GetFile(Config.Dir.Config, SettingsFileName);
if (ExportFileName != string.Empty)
{
tmpConfigFileName = ExportFileName;
}
using (Settings xmlwriter = new Settings(tmpConfigFileName))
{
xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmDisableLBGlobaly, DisableLBGlobaly);
xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmVerboselog, verboseLog);
xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmShowSwitchMsg, ShowSwitchMsg);
xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmUseFallbackRule, UseFallbackRule);
xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmDisableForVideo, disableForVideo);
xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmDisableLBForVideo, disableLBForVideo);
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmFallbackViewMode, FallBackViewMode.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRuleCount, ViewModeRules.Count.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmBlackLevel, LBMaxBlackLevel.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, FallBackOverScan, fboverScan.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmMinBlackLevel, LBMinBlackLevel.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmSymLimitPercent, LBSymLimitPercent.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmLBdetectInterval, LBdetectInterval.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmMaxCropLimitPercent, LBMaxCropLimitPercent.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmDetectWidthPercent, DetectWidthPercent.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmDetectHeightPercent, DetectHeightPercent.ToString());
for (int i = 1; i <= ViewModeRules.Count; i++)
{
Rule tmpRule = ViewModeRules[i - 1];
xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmRulePrefix + i + "Enabled",
tmpRule.Enabled);
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRulePrefix + i + "Name", tmpRule.Name);
int tmpARFrom = Convert.ToInt32(tmpRule.ARFrom * 1000.0);
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRulePrefix + i + "ARFromX1000",
tmpARFrom.ToString());
int tmpARTo = Convert.ToInt32(tmpRule.ARTo * 1000.0);
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRulePrefix + i + "ARToX1000",
tmpARTo.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRulePrefix + i + "MinWidth",
tmpRule.MinWidth.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRulePrefix + i + "MaxWidth",
tmpRule.MaxWidth.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRulePrefix + i + "MinHeight",
tmpRule.MinHeight.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRulePrefix + i + "MaxHeight",
tmpRule.MaxHeight.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRulePrefix + i + "ViewMode",
tmpRule.ViewMode.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRulePrefix + i + "Overscan",
tmpRule.OverScan.ToString());
xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmRulePrefix + i + "EnableLBDetection",
tmpRule.EnableLBDetection);
xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmRulePrefix + i + "AutoCrop",
tmpRule.AutoCrop);
xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmRulePrefix + i + "MaxCrop",
tmpRule.MaxCrop);
}
if (ExportFileName != string.Empty)
{
Settings.SaveCache();
}
}
}
示例5: SaveSettings
public void SaveSettings(string ExportFileName)
{
string tmpConfigFileName = Config.GetFile(Config.Dir.Config, "ViewModeSwitcher.xml");
if (ExportFileName != string.Empty)
{
tmpConfigFileName = ExportFileName;
}
using (Settings xmlwriter = new Settings(tmpConfigFileName))
{
xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmDisableLBGlobaly, DisableLBGlobaly);
xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmVerboselog, verboseLog);
xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmShowSwitchMsg, ShowSwitchMsg);
xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmUseFallbackRule, UseFallbackRule);
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmFallbackViewMode, FallBackViewMode.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRuleCount, ViewModeRules.Count.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmBlackLevel, LBBlackLevel.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, FallBackOverScan, fboverScan.ToString());
for (int i = 1; i <= ViewModeRules.Count; i++)
{
Rule tmpRule = ViewModeRules[i - 1];
xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmRulePrefix + i + "Enabled",
tmpRule.Enabled);
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRulePrefix + i + "Name", tmpRule.Name);
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRulePrefix + i + "ARFrom",
tmpRule.ARFrom.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRulePrefix + i + "ARTo",
tmpRule.ARTo.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRulePrefix + i + "MinWidth",
tmpRule.MinWidth.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRulePrefix + i + "MaxWidth",
tmpRule.MaxWidth.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRulePrefix + i + "MinHeight",
tmpRule.MinHeight.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRulePrefix + i + "MaxHeight",
tmpRule.MaxHeight.ToString());
xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmRulePrefix + i + "ChangeAR",
tmpRule.ChangeAR);
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRulePrefix + i + "ViewMode",
tmpRule.ViewMode.ToString());
xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmRulePrefix + i + "ChangeOS",
tmpRule.ChangeOs);
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRulePrefix + i + "Overscan",
tmpRule.OverScan.ToString());
xmlwriter.SetValueAsBool(ViewModeSwitcherSectionName, ParmRulePrefix + i + "EnableLBDetection",
tmpRule.EnableLBDetection);
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRulePrefix + i + "VerticalOffSetZoom",
tmpRule.VerticalOffSetZoom.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRulePrefix + i + "VerticalOffSet14_9",
tmpRule.VerticalOffSet14_9.ToString());
xmlwriter.SetValue(ViewModeSwitcherSectionName, ParmRulePrefix + i + "VerticalOffSetWide14_9",
tmpRule.VerticalOffSetWide14_9.ToString());
}
if (ExportFileName != string.Empty)
{
Settings.SaveCache();
}
}
}
示例6: SaveSettings
public static void SaveSettings()
{
SaveMyPicturesSlideShowFolders();
//
try
{
logger.Debug("Save settings to: " + ConfigFilename);
#region Save settings
using (var xmlwriter = new Settings(Config.GetFile((Config.Dir) 10, ConfigFilename)))
{
xmlwriter.SetValueAsBool("FanartHandler", "UseFanart", UseFanart);
xmlwriter.SetValueAsBool("FanartHandler", "UseAlbum", UseAlbum);
xmlwriter.SetValueAsBool("FanartHandler", "UseArtist", UseArtist);
xmlwriter.SetValueAsBool("FanartHandler", "SkipWhenHighResAvailable", SkipWhenHighResAvailable);
xmlwriter.SetValueAsBool("FanartHandler", "DisableMPTumbsForRandom", DisableMPTumbsForRandom);
xmlwriter.SetValueAsBool("FanartHandler", "UseSelectedMusicFanart", UseSelectedMusicFanart);
xmlwriter.SetValueAsBool("FanartHandler", "UseSelectedOtherFanart", UseSelectedOtherFanart);
xmlwriter.SetValue("FanartHandler", "ImageInterval", ImageInterval);
xmlwriter.SetValue("FanartHandler", "MinResolution", MinResolution);
xmlwriter.SetValue("FanartHandler", "ScraperMaxImages", ScraperMaxImages);
xmlwriter.SetValueAsBool("FanartHandler", "ScraperMusicPlaying", ScraperMusicPlaying);
xmlwriter.SetValueAsBool("FanartHandler", "ScraperMPDatabase", ScraperMPDatabase);
xmlwriter.SetValue("FanartHandler", "ScraperInterval", ScraperInterval);
xmlwriter.SetValueAsBool("FanartHandler", "UseAspectRatio", UseAspectRatio);
xmlwriter.SetValueAsBool("FanartHandler", "ScrapeThumbnails", ScrapeThumbnails);
xmlwriter.SetValueAsBool("FanartHandler", "ScrapeThumbnailsAlbum", ScrapeThumbnailsAlbum);
xmlwriter.SetValueAsBool("FanartHandler", "DoNotReplaceExistingThumbs", DoNotReplaceExistingThumbs);
xmlwriter.SetValueAsBool("FanartHandler", "UseDefaultBackdrop", UseDefaultBackdrop);
xmlwriter.SetValue("FanartHandler", "DefaultBackdropMask", DefaultBackdropMask);
xmlwriter.SetValueAsBool("FanartHandler", "UseGenreFanart", UseGenreFanart);
xmlwriter.SetValueAsBool("FanartHandler", "ScanMusicFoldersForFanart", ScanMusicFoldersForFanart);
xmlwriter.SetValue("FanartHandler", "MusicFoldersArtistAlbumRegex", MusicFoldersArtistAlbumRegex);
xmlwriter.SetValue("FanartHandler", "FanartTVPersonalAPIKey", FanartTVPersonalAPIKey);
xmlwriter.SetValueAsBool("FanartHandler", "DeleteMissing", DeleteMissing);
xmlwriter.SetValueAsBool("FanartHandler", "UseHighDefThumbnails", UseHighDefThumbnails);
xmlwriter.SetValueAsBool("FanartHandler", "UseMinimumResolutionForDownload", UseMinimumResolutionForDownload);
xmlwriter.SetValueAsBool("FanartHandler", "ShowDummyItems", ShowDummyItems);
xmlwriter.SetValueAsBool("FanartHandler", "UseMyPicturesSlideShow", UseMyPicturesSlideShow);
// xmlwriter.SetValueAsBool("FanartHandler", "FastScanMyPicturesSlideShow", FastScanMyPicturesSlideShow);
//
xmlwriter.SetValueAsBool("Providers", "UseFanartTV", UseFanartTV);
xmlwriter.SetValueAsBool("Providers", "UseHtBackdrops", UseHtBackdrops);
xmlwriter.SetValueAsBool("Providers", "UseLastFM", UseLastFM);
xmlwriter.SetValueAsBool("Providers", "UseCoverArtArchive", UseCoverArtArchive);
//
xmlwriter.SetValueAsBool("Scraper", "AddAdditionalSeparators", AddAdditionalSeparators);
//
xmlwriter.SetValueAsBool("FanartTV", "MusicClearArtDownload", MusicClearArtDownload);
xmlwriter.SetValueAsBool("FanartTV", "MusicBannerDownload", MusicBannerDownload);
xmlwriter.SetValueAsBool("FanartTV", "MusicCDArtDownload", MusicCDArtDownload);
xmlwriter.SetValueAsBool("FanartTV", "MoviesClearArtDownload", MoviesClearArtDownload);
xmlwriter.SetValueAsBool("FanartTV", "MoviesBannerDownload", MoviesBannerDownload);
xmlwriter.SetValueAsBool("FanartTV", "MoviesCDArtDownload", MoviesCDArtDownload);
xmlwriter.SetValueAsBool("FanartTV", "MoviesClearLogoDownload", MoviesClearLogoDownload);
// xmlwriter.SetValueAsBool("FanartTV", "MoviesFanartNameAsMediaportal", MoviesFanartNameAsMediaportal);
//
xmlwriter.SetValue("FanartTV", "FanartTVLanguage", FanartTVLanguage);
xmlwriter.SetValueAsBool("FanartTV", "FanartTVLanguageToAny", FanartTVLanguageToAny);
//
}
#endregion
/*
try
{
xmlwriter.SaveCache();
}
catch
{ }
*/
logger.Debug("Save settings to: " + ConfigFilename + " complete.");
}
catch (Exception ex)
{
logger.Error("SaveSettings: " + ex);
}
}