本文整理汇总了C#中ISettings.Get方法的典型用法代码示例。如果您正苦于以下问题:C# ISettings.Get方法的具体用法?C# ISettings.Get怎么用?C# ISettings.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISettings
的用法示例。
在下文中一共展示了ISettings.Get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SettingsPageViewModel
public SettingsPageViewModel(ISettings settings, INavigationService navigationService)
: base(navigationService)
{
this.settings = settings;
RecentItems =
new List<string>(new[]
{
"None",
"5", "10",
"15", "20",
"No limit"
});
MaxVolume = settings.Get<int>("MaxVolume").Select(x => x.ToString(CultureInfo.InvariantCulture)).GetOrElse("100");
ShouldUploadPlots = settings.Get<bool>("ShouldAutomaticallyUploadPlots").GetOrElse(false);
RecentItemsShown =
settings.Get<string>("RecentItemsShown")
.GetOrElse(() => RecentItems.Last());
}
示例2: OptionsOptionControl
public OptionsOptionControl(ScreenComponent manager, OptionsScreen optionsScreen)
: base(manager)
{
settings = manager.Game.Settings;
this.optionsScreen = optionsScreen;
////////////////////////////////////////////Settings Stack////////////////////////////////////////////
StackPanel settingsStack = new StackPanel(manager)
{
Orientation = Orientation.Vertical,
VerticalAlignment = VerticalAlignment.Top,
Padding = new Border(20, 20, 20, 20),
Width = 650
};
Controls.Add(settingsStack);
//////////////////////Viewrange//////////////////////
string viewrange = settings.Get<string>("Viewrange");
rangeTitle = new Label(manager)
{
Text = Languages.OctoClient.Viewrange + ": " + viewrange
};
settingsStack.Controls.Add(rangeTitle);
Slider viewrangeSlider = new Slider(manager)
{
HorizontalAlignment = HorizontalAlignment.Stretch,
Height = 20,
Range = 9,
Value = int.Parse(viewrange) - 1
};
viewrangeSlider.ValueChanged += (value) => SetViewrange(value + 1);
settingsStack.Controls.Add(viewrangeSlider);
//////////////////////Persistence//////////////////////
StackPanel persistenceStack = new StackPanel(manager)
{
Orientation = Orientation.Horizontal,
Margin = new Border(0, 20, 0, 0)
};
settingsStack.Controls.Add(persistenceStack);
Label persistenceTitle = new Label(manager)
{
Text = Languages.OctoClient.DisablePersistence + ":"
};
persistenceStack.Controls.Add(persistenceTitle);
Checkbox disablePersistence = new Checkbox(manager)
{
Checked = bool.Parse(settings.Get<string>("DisablePersistence")),
HookBrush = new TextureBrush(manager.Game.Assets.LoadTexture(typeof(ScreenComponent), "iconCheck_brown"), TextureBrushMode.Stretch),
};
disablePersistence.CheckedChanged += (state) => SetPersistence(state);
persistenceStack.Controls.Add(disablePersistence);
//////////////////////Map Path//////////////////////
StackPanel mapPathStack = new StackPanel(manager)
{
Orientation = Orientation.Vertical,
Margin = new Border(0, 20, 0, 0),
HorizontalAlignment = HorizontalAlignment.Stretch
};
settingsStack.Controls.Add(mapPathStack);
mapPath = new Textbox(manager)
{
Text = settings.Get<string>("ChunkRoot"),
Enabled = false,
HorizontalAlignment = HorizontalAlignment.Stretch,
Background = new BorderBrush(Color.LightGray, LineType.Solid, Color.Gray)
};
mapPathStack.Controls.Add(mapPath);
Button changePath = Button.TextButton(manager, Languages.OctoClient.ChangePath);
changePath.HorizontalAlignment = HorizontalAlignment.Center;
changePath.Height = 40;
changePath.LeftMouseClick += (s, e) => ChangePath();
mapPathStack.Controls.Add(changePath);
//////////////////////Fullscreen//////////////////////
StackPanel fullscreenStack = new StackPanel(manager)
{
Orientation = Orientation.Horizontal,
Margin = new Border(0, 20, 0, 0)
};
settingsStack.Controls.Add(fullscreenStack);
Label fullscreenTitle = new Label(manager)
{
Text = Languages.OctoClient.EnableFullscreenOnStartup + ":"
};
fullscreenStack.Controls.Add(fullscreenTitle);
Checkbox enableFullscreen = new Checkbox(manager)
{
Checked = bool.Parse(settings.Get<string>("EnableFullscreen")),
HookBrush = new TextureBrush(manager.Game.Assets.LoadTexture(typeof(ScreenComponent), "iconCheck_brown"), TextureBrushMode.Stretch),
};
//.........这里部分代码省略.........
示例3: GetAppId
public override string GetAppId(ISettings appSettings)
{
return appSettings.Get("google:appid");
}
示例4: GetAppId
public override string GetAppId(ISettings appSettings)
{
Requires.NotNull(appSettings, "appSettings");
return appSettings.Get(AppIdKey);
}