示例#1
0
        public static NameBox getNameBox()
        {
            if (nameBox == null){
                nameBox =  new NameBox();
            }

            return nameBox;
        }
示例#2
0
        public static NameBox getNameBox()
        {
            if (nameBox == null)
            {
                nameBox = new NameBox();
            }

            return(nameBox);
        }
示例#3
0
        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);
            }
        }