private void OnSubmitSubscription(object sender, RoutedEventArgs e)
 {
     if (_login.Text.Trim() != "" && _password.Text.Trim() != "")
     {
         try
         {
             mainWindow.ChannelFactory = new DuplexChannelFactory <IBomberService>(mainWindow, "BomberServiceEndpoint");
             mainWindow.Server         = mainWindow.ChannelFactory.CreateChannel();
             var account = new AccountDC()
             {
                 Login    = _login.Text,
                 Password = _password.Text
             };
             var player = new PlayerDC()
             {
                 Pseudonym         = _pseudonym.Text,
                 PlayerDescription = _playerDescription.Text,
             };
             if (player.Pseudonym.Trim() == "")
             {
                 player.Pseudonym = account.Login;
             }
             mainWindow.Server.CreateAccount(account, player);
             mainWindow.IsEnabled = false;
         }
         catch
         {
             MessageBox.Show("Conexion failure... Please try again later.");
         }
     }
     else
     {
         MessageBox.Show("Please choose a login and password before submitting.");
     }
 }
예제 #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();

            services.AddMediatR(typeof(Startup));

            DependencyContainer.RegisterBaseServices(services, Configuration);
            AccountDC.RegisterServices(services, Configuration);
        }