本文整理汇总了C#中ISettings.Set方法的典型用法代码示例。如果您正苦于以下问题:C# ISettings.Set方法的具体用法?C# ISettings.Set怎么用?C# ISettings.Set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISettings
的用法示例。
在下文中一共展示了ISettings.Set方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateUniverseScreen
public CreateUniverseScreen(ScreenComponent manager)
: base(manager)
{
Manager = manager;
settings = manager.Game.Settings;
Padding = new Border(0, 0, 0, 0);
Title = Languages.OctoClient.CreateUniverse;
SetDefaultBackground();
Panel panel = new Panel(manager);
panel.VerticalAlignment = VerticalAlignment.Stretch;
panel.HorizontalAlignment = HorizontalAlignment.Stretch;
panel.Margin = Border.All(50);
panel.Background = new BorderBrush(Color.White * 0.5f);
panel.Padding = Border.All(10);
Controls.Add(panel);
Grid grid = new Grid(manager);
grid.VerticalAlignment = VerticalAlignment.Stretch;
grid.HorizontalAlignment = HorizontalAlignment.Stretch;
panel.Controls.Add(grid);
grid.Columns.Add(new ColumnDefinition() { ResizeMode = ResizeMode.Auto });
grid.Columns.Add(new ColumnDefinition() { Width = 1,ResizeMode = ResizeMode.Parts });
nameInput = GetTextbox();
nameInput.TextChanged += (s, e) => {
createButton.Visible = !string.IsNullOrEmpty(e.NewValue);
};
AddLabeledControl(grid, string.Format("{0}: ", Languages.OctoClient.Name), nameInput);
seedInput = GetTextbox();
AddLabeledControl(grid, string.Format("{0}: ", Languages.OctoClient.Seed), seedInput);
createButton = Button.TextButton(manager, Languages.OctoClient.Create);
createButton.HorizontalAlignment = HorizontalAlignment.Right;
createButton.VerticalAlignment = VerticalAlignment.Bottom;
createButton.Visible = false;
createButton.LeftMouseClick += (s, e) =>
{
if (string.IsNullOrEmpty(nameInput.Text))
return;
int? seed = null;
int textseed;
if (int.TryParse(seedInput.Text, out textseed))
seed = textseed;
manager.Player.RemovePlayer();
Guid guid = Manager.Game.Simulation.NewGame(nameInput.Text, seed);
settings.Set("LastUniverse", guid.ToString());
manager.Game.Player.InsertPlayer();
manager.NavigateToScreen(new GameScreen(manager));
};
panel.Controls.Add(createButton);
}