本文整理汇总了C#中Settings.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Settings.SetValue方法的具体用法?C# Settings.SetValue怎么用?C# Settings.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Settings
的用法示例。
在下文中一共展示了Settings.SetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SongRequestsWindow
public SongRequestsWindow(IExtension sender)
{
extension = sender;
InitializeComponent();
ini = SongRequest.ini; new Settings(extension, "Settings.ini");
UI.CenterSpacer(RequestingRulesLabel, RequestingRulesSpacer, false, true);
ChargeRequest.Text = "Requesting costs " + Currency.Name;
ini.SetValue("Settings", "ChargeRequest", (ChargeRequest.Checked = (ini.GetValue("Settings", "ChargeRequest", "1") == "1")) ? "1" : "0");
int variable = Convert.ToInt32(ini.GetValue("Settings", "RequestPrice", "25"));
if (variable > RequestPrice.Maximum || variable < RequestPrice.Minimum)
{
variable = 25;
}
ini.SetValue("Settings", "RequestPrice", (RequestPrice.Value = variable).ToString());
ini.SetValue("Settings", "LimitRequests", (LimitRequests.Checked = (ini.GetValue("Settings", "LimitRequests", "1") == "1")) ? "1" : "0");
variable = Convert.ToInt32(ini.GetValue("Settings", "RequestsLimit", "2"));
if (variable > RequestsLimit.Maximum || variable < RequestsLimit.Minimum)
{
variable = 2;
}
ini.SetValue("Settings", "RequestsLimit", (RequestsLimit.Value = variable).ToString());
}
示例2: SaveSettings
public override void SaveSettings()
{
using (Settings xmlreader = new Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml")))
{
xmlreader.SetValue("nls", "center zone", numNlsCenterZone.Value);
xmlreader.SetValue("nls", "zoom", numNlsZoom.Value);
xmlreader.SetValue("nls", "stretchx", numNlsStretchX.Value);
xmlreader.SetValue("nls", "vertpos", numNlsVertPos.Value);
}
}
示例3: Load
public void Load()
{
Events.Connected += Events_Connected;
Events.Users.UserlistRefreshed += Events_UserlistRefreshed;
Events.Users.Added += Events_UserAdded;
Settings = new Settings(this, "Greetings.ini");
Settings.SetValue("Settings", "Message", Message = Settings.GetValue("Settings", "Message", "Hello {user}! Welcome to the stream!"));
Settings.SetValue("Settings", "On", (On = (Settings.GetValue("Settings", "On", "0") == "1")) ? "1" : "0");
}
示例4: Load
public void Load()
{
// Load what you want to do here.
Settings settings = new Settings(this, "example.ini"); // Register a settings file.
settings.SetValue("Example Section", "SuccessfulExample", "0"); // Set or create a value named "SuccessfulExample" under the section "Example Section", with the value "0".
Events.Connected += Events_Connected; // Register an event handler to add our custom command.
UI.AddWindow("Example", new ExampleWindow());
settings.SetValue("Example Section", "SuccessfulExample", "1"); // Change the value of "SuccessfulExample" to "1".
string Example = settings.GetValue("Example Section", "SuccessfulExample", "0"); // Check the value of "SuccessfulExample", if "SuccessfulExample" is missing, use a default value of "0".
if (Example == "1") // Check if "SuccessfulExample" under "Example Section" is "1".
{
Console.WriteLine("Successful example, hurray!"); // Print this message to the console if "SuccessfulExample" has been "1".
}
}
示例5: CreateTemporaryConfiguration
private string CreateTemporaryConfiguration()
{
string tempSettingsFilename = Path.Combine(_tempDir, "MediaPortalTemp.xml");
// check if Mediaportal has been configured, if not start configuration.exe in wizard mode
var fi = new FileInfo(MPSettings.ConfigPathName);
if (!File.Exists(MPSettings.ConfigPathName) || (fi.Length < 10000))
{
MessageBox.Show("MediaPortal has never been configured.", "Configuration not found", MessageBoxButtons.OK, MessageBoxIcon.Error);
try
{
var process = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = Config.GetFile(Config.Dir.Base, "configuration.exe"),
Arguments = @"/wizard"
}
};
process.Start();
process.WaitForExit();
}
catch {}
}
try
{
File.Copy(MPSettings.ConfigPathName, tempSettingsFilename, true);
using (Settings xmlreader = new Settings(tempSettingsFilename, false))
{
xmlreader.SetValue("general", "loglevel", 3);
}
}
catch (Exception)
{
File.Delete(tempSettingsFilename);
throw;
}
return tempSettingsFilename;
}
示例6: SaveStringSettings
private static void SaveStringSettings(Settings xmlWriter)
{
Dictionary<int, SkinString>.Enumerator strEnumer = _skinStringSettings.GetEnumerator();
SkinString strSetting;
while (strEnumer.MoveNext())
{
strSetting = strEnumer.Current.Value;
if (strSetting.Kind == Kind.PERSISTENT)
{
xmlWriter.SetValue("stringsettings", strSetting.Name, strSetting.Value);
}
}
}
示例7: SaveDiscreteSettings
private static void SaveDiscreteSettings(Settings xmlWriter)
{
// Theme settings
xmlWriter.SetValue(THEME_SECTION_NAME, THEME_NAME_ENTRY, GUIThemeManager.CurrentTheme);
}
示例8: CreateDefaultGenreColors
private void CreateDefaultGenreColors(Settings settings)
{
// Insert a default collection of TV guide genres.
for (int i = 0; i < _defaultGenreColors.Count; i++)
{
settings.SetValue("tvguidecolors", i.ToString(), _defaultGenreColors[i]);
}
}
示例9: UpgradeSettings
public static void UpgradeSettings(Settings xmlwriter)
{
#region Init temp Variables
var u_UseFanart = string.Empty;
var u_UseAlbum = string.Empty;
var u_UseArtist = string.Empty;
var u_SkipWhenHighResAvailable = string.Empty;
var u_DisableMPTumbsForRandom = string.Empty;
var u_ImageInterval = string.Empty;
var u_MinResolution = string.Empty;
var u_ScraperMaxImages = string.Empty;
var u_ScraperMusicPlaying = string.Empty;
var u_ScraperMPDatabase = string.Empty;
var u_ScraperInterval = string.Empty;
var u_UseAspectRatio = string.Empty;
var u_ScrapeThumbnails = string.Empty;
var u_ScrapeThumbnailsAlbum = string.Empty;
var u_DoNotReplaceExistingThumbs = string.Empty;
var u_UseSelectedMusicFanart = string.Empty;
var u_UseSelectedOtherFanart = string.Empty;
var u_UseGenreFanart = string.Empty;
var u_ScanMusicFoldersForFanart = string.Empty;
var u_UseDefaultBackdrop = string.Empty;
var u_AddAdditionalSeparators = string.Empty;
var u_Separators = string.Empty ;
#endregion
try
{
logger.Debug("Upgrade settings file: " + ConfigFilename);
#region Read Old Entry
try
{
u_UseFanart = xmlwriter.GetValueAsString("FanartHandler", "useFanart", string.Empty);
u_UseAlbum = xmlwriter.GetValueAsString("FanartHandler", "useAlbum", string.Empty);
u_UseArtist = xmlwriter.GetValueAsString("FanartHandler", "useArtist", string.Empty);
u_SkipWhenHighResAvailable = xmlwriter.GetValueAsString("FanartHandler", "skipWhenHighResAvailable", string.Empty);
u_DisableMPTumbsForRandom = xmlwriter.GetValueAsString("FanartHandler", "disableMPTumbsForRandom", string.Empty);
u_ImageInterval = xmlwriter.GetValueAsString("FanartHandler", "imageInterval", string.Empty);
u_MinResolution = xmlwriter.GetValueAsString("FanartHandler", "minResolution", string.Empty);
u_ScraperMaxImages = xmlwriter.GetValueAsString("FanartHandler", "scraperMaxImages", string.Empty);
u_ScraperMusicPlaying = xmlwriter.GetValueAsString("FanartHandler", "scraperMusicPlaying", string.Empty);
u_ScraperMPDatabase = xmlwriter.GetValueAsString("FanartHandler", "scraperMPDatabase", string.Empty);
u_ScraperInterval = xmlwriter.GetValueAsString("FanartHandler", "scraperInterval", string.Empty);
u_UseAspectRatio = xmlwriter.GetValueAsString("FanartHandler", "useAspectRatio", string.Empty);
u_ScrapeThumbnails = xmlwriter.GetValueAsString("FanartHandler", "scrapeThumbnails", string.Empty);
u_ScrapeThumbnailsAlbum = xmlwriter.GetValueAsString("FanartHandler", "scrapeThumbnailsAlbum", string.Empty);
u_DoNotReplaceExistingThumbs = xmlwriter.GetValueAsString("FanartHandler", "doNotReplaceExistingThumbs", string.Empty);
u_UseSelectedMusicFanart = xmlwriter.GetValueAsString("FanartHandler", "useSelectedMusicFanart", string.Empty);
u_UseSelectedOtherFanart = xmlwriter.GetValueAsString("FanartHandler", "useSelectedOtherFanart", string.Empty);
u_UseDefaultBackdrop = xmlwriter.GetValueAsString("FanartHandler", "useDefaultBackdrop", string.Empty);
u_UseGenreFanart = xmlwriter.GetValueAsString("FanartHandler", "UseGenreFanart", string.Empty);
u_ScanMusicFoldersForFanart = xmlwriter.GetValueAsString("FanartHandler", "ScanMusicFoldersForFanart", string.Empty);
//
u_AddAdditionalSeparators = xmlwriter.GetValueAsString("Scraper", "AndSignAsSeparator", string.Empty);
u_Separators = xmlwriter.GetValueAsString("Separators", "sep0", string.Empty);
}
catch
{ }
#endregion
#region Write New Entry
if (!string.IsNullOrEmpty(u_UseFanart))
xmlwriter.SetValue("FanartHandler", "UseFanart", u_UseFanart.Replace("True","yes").Replace("False","no"));
if (!string.IsNullOrEmpty(u_UseAlbum))
xmlwriter.SetValue("FanartHandler", "UseAlbum", u_UseAlbum.Replace("True","yes").Replace("False","no"));
if (!string.IsNullOrEmpty(u_UseArtist))
xmlwriter.SetValue("FanartHandler", "UseArtist", u_UseArtist.Replace("True","yes").Replace("False","no"));
if (!string.IsNullOrEmpty(u_SkipWhenHighResAvailable))
xmlwriter.SetValue("FanartHandler", "SkipWhenHighResAvailable", u_SkipWhenHighResAvailable.Replace("True","yes").Replace("False","no"));
if (!string.IsNullOrEmpty(u_DisableMPTumbsForRandom))
xmlwriter.SetValue("FanartHandler", "DisableMPTumbsForRandom", u_DisableMPTumbsForRandom.Replace("True","yes").Replace("False","no"));
if (!string.IsNullOrEmpty(u_UseSelectedMusicFanart))
xmlwriter.SetValue("FanartHandler", "UseSelectedMusicFanart", u_UseSelectedMusicFanart.Replace("True","yes").Replace("False","no"));
if (!string.IsNullOrEmpty(u_UseSelectedOtherFanart))
xmlwriter.SetValue("FanartHandler", "UseSelectedOtherFanart", u_UseSelectedOtherFanart.Replace("True","yes").Replace("False","no"));
if (!string.IsNullOrEmpty(u_ImageInterval))
xmlwriter.SetValue("FanartHandler", "ImageInterval", u_ImageInterval);
if (!string.IsNullOrEmpty(u_MinResolution))
xmlwriter.SetValue("FanartHandler", "MinResolution", u_MinResolution);
if (!string.IsNullOrEmpty(u_ScraperMaxImages))
xmlwriter.SetValue("FanartHandler", "ScraperMaxImages", u_ScraperMaxImages);
if (!string.IsNullOrEmpty(u_ScraperMusicPlaying))
xmlwriter.SetValue("FanartHandler", "ScraperMusicPlaying", u_ScraperMusicPlaying.Replace("True","yes").Replace("False","no"));
if (!string.IsNullOrEmpty(u_ScraperMPDatabase))
xmlwriter.SetValue("FanartHandler", "ScraperMPDatabase", u_ScraperMPDatabase.Replace("True","yes").Replace("False","no"));
if (!string.IsNullOrEmpty(u_ScraperInterval))
xmlwriter.SetValue("FanartHandler", "ScraperInterval", u_ScraperInterval.Replace("True","yes").Replace("False","no"));
if (!string.IsNullOrEmpty(u_UseAspectRatio))
xmlwriter.SetValue("FanartHandler", "UseAspectRatio", u_UseAspectRatio.Replace("True","yes").Replace("False","no"));
if (!string.IsNullOrEmpty(u_ScrapeThumbnails))
xmlwriter.SetValue("FanartHandler", "ScrapeThumbnails", u_ScrapeThumbnails.Replace("True","yes").Replace("False","no"));
if (!string.IsNullOrEmpty(u_ScrapeThumbnailsAlbum))
xmlwriter.SetValue("FanartHandler", "ScrapeThumbnailsAlbum", u_ScrapeThumbnailsAlbum.Replace("True","yes").Replace("False","no"));
if (!string.IsNullOrEmpty(u_DoNotReplaceExistingThumbs))
xmlwriter.SetValue("FanartHandler", "DoNotReplaceExistingThumbs", u_DoNotReplaceExistingThumbs.Replace("True","yes").Replace("False","no"));
if (!string.IsNullOrEmpty(u_UseDefaultBackdrop))
xmlwriter.SetValue("FanartHandler", "UseDefaultBackdrop", u_UseDefaultBackdrop.Replace("True","yes").Replace("False","no"));
if (!string.IsNullOrEmpty(u_UseGenreFanart))
xmlwriter.SetValue("FanartHandler", "UseGenreFanart", u_UseGenreFanart.Replace("True","yes").Replace("False","no"));
if (!string.IsNullOrEmpty(u_ScanMusicFoldersForFanart))
//.........这里部分代码省略.........
示例10: 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();
}
}
}
示例11: SaveGroupAndChannelSettings
private void SaveGroupAndChannelSettings(Settings xmlwriter, ChannelType channelType, string section)
{
try
{
if (_currentChannelGroup != null
&& _currentChannelGroup.ChannelType == channelType)
{
xmlwriter.SetValue(section, "group", _currentChannelGroup.GroupName);
}
else if (_navigatorChannels[channelType].LastChannelGroup != null)
{
xmlwriter.SetValue(section, "group", _navigatorChannels[channelType].LastChannelGroup.GroupName);
}
else
{
xmlwriter.SetValue(section, "group", String.Empty);
}
}
catch (Exception){}
try
{
if (_currentChannel != null
&& _currentChannel.ChannelType == channelType)
{
xmlwriter.SetValue(section, "channel", _currentChannel.DisplayName);
}
else if (_navigatorChannels[channelType].LastChannel != null)
{
xmlwriter.SetValue(section, "channel", _navigatorChannels[channelType].LastChannel.DisplayName);
}
else
{
xmlwriter.SetValue(section, "channel", String.Empty);
}
}
catch (Exception){}
}
示例12: 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();
}
示例13: SaveSettings
/// <summary>
/// Saves the settings.
/// </summary>
private static void SaveSettings()
{
try
{
using (Settings xmlwriter = new Settings(MPCommon.MPConfigFile))
{
xmlwriter.SetValue("TV2BlasterPlugin", "ServerHost", ServerHost);
}
}
catch (Exception ex)
{
Log.Error(ex);
}
}
示例14: 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();
}
}
}
示例15: 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);
}
}