Esempio n. 1
0
 public Login()
 {
     InitializeComponent();
     config          = new ConfigMethods();
     View            = new ViewManagment();
     win             = Application.Current.Windows.OfType <MainWindow>().First();
     NamePlayer.Text = config.GetPlayerName().Length > 0 ? config.GetPlayerName() : String.Empty;
 }
Esempio n. 2
0
        private void SetName(object sender, RoutedEventArgs e)
        {
            if (NamePlayer.Text.Length == 0)
            {
                return;
            }
            config.SetPlayerName(NamePlayer.Text);
            win.EnableTimer = (Boolean)EnableTimer.IsChecked;
            switch (config.GetLevel())
            {
            case "1":
                View.RedirectUrl("FirstLevel.xaml");
                break;

            case "2":
                View.RedirectUrl("SecondLevel.xaml");
                break;

            case "3":
                View.RedirectUrl("ThirdLevel.xaml");
                break;

            default: break;
            }
            var w = Application.Current.Windows.OfType <MainWindow>().First();

            w.Player.Text += config.GetPlayerName();
        }