本文整理汇总了C#中Settings.Reload方法的典型用法代码示例。如果您正苦于以下问题:C# Settings.Reload方法的具体用法?C# Settings.Reload怎么用?C# Settings.Reload使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Settings
的用法示例。
在下文中一共展示了Settings.Reload方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadSettings
private void LoadSettings()
{
_settings = PushToTalk.Properties.Settings.Default;
_settings.Reload();
// Read settings
_key = _settings.DefaultKey;
String message = _lookup.GetMessage(_key);
lblDirections.Content = "Current Key: ";
lblKey.Content = message;
_keyDownVolumeLevel = (float)_settings.VolumeLevelOnKeyDown;
_volumeSlider.Value = _settings.VolumeLevelOnKeyDown * 100.0;
Console.WriteLine("Loaded volume settings. Volume=" + _settings.VolumeLevelOnKeyDown);
// Apply minimizetotray if applicable
if (_settings.MinimizeToTray) {
_minimizeCheckBox.IsChecked = true;
MinimizeToTray.Enable();
} else {
_minimizeCheckBox.IsChecked = false;
MinimizeToTray.Disable();
}
}
示例2: XmlHeader
[Test] //Covers 36388
public void XmlHeader ()
{
try {
var settings = new Settings ();
settings.Reset ();
settings.Save ();
settings.WindowPositions = new WindowPositionList ();
settings.Save ();
// If Reloads fails then saved data is corrupted
settings.Reload ();
} catch (ConfigurationErrorsException e) {
// Delete corrupted config file so other test won't fail.
File.Delete (e.Filename);
Assert.Fail ("Invalid data was saved to config file.");
}
}