public static NameBox getNameBox() { if (nameBox == null){ nameBox = new NameBox(); } return nameBox; }
public static NameBox getNameBox() { if (nameBox == null) { nameBox = new NameBox(); } return(nameBox); }
public void Render() { // set player name NameBox box = NameBox.getNameBox(); if (box.ShowDialog() == DialogResult.OK) { // write in registry for later refrence :-) RegistryKey regKey = Registry.CurrentUser.CreateSubKey("Software\\Games\\CallBreak"); if (regKey != null) { regKey.SetValue("PlayerName", box.playerNameTextBox.Text.Trim()); regKey.Close(); } Cards.Main.playerName = box.playerNameTextBox.Text.Trim(); } else { Environment.Exit(0); } }