private void GetAlliancePower(object sender, RoutedEventArgs e)
 {
     MessageOnException.Execute(() =>
     {
         var power = _empiresManager.GetOneAlliancePower();
         AlliancePowerBlock.Text = power.ToString();
     });
 }
 private void SetAlliancePower(object sender, RoutedEventArgs e)
 {
     MessageOnException.Execute(() =>
     {
         var power = _empiresManager.GetSumOfPowers();
         _empiresManager.SetOneAlliancePower(power);
     });
 }
 private void FetchEmpires(object sender, RoutedEventArgs e)
 {
     EmpireListView.Items.Clear();
     MessageOnException.Execute(() =>
     {
         foreach (var empire in EmpiresManager.GetEmpires())
         {
             EmpireListView.Items.Add(empire);
         }
     });
 }
 private void IncreasePower(object sender, RoutedEventArgs e)
 {
     MessageOnException.Execute(() =>
     {
         foreach (var item in EmpiresList.EmpireListView.Items)
         {
             var empire = (Empire)item;
             _empiresManager.SetPower(empire.Id, empire.Power + Power);
         }
     });
 }
 private void Reload(object sender, RoutedEventArgs e)
 {
     FirstEmpireBox.Items.Clear();
     SecondEmpireBox.Items.Clear();
     MessageOnException.Execute(() =>
     {
         foreach (var empire in _empiresManager.GetEmpires())
         {
             FirstEmpireBox.Items.Add(empire);
             SecondEmpireBox.Items.Add(empire);
         }
     });
 }
        private void AddEmpire(object sender, RoutedEventArgs e)
        {
            var empire = new Empire
            {
                Name             = EmpireNameBox.Text,
                Power            = int.Parse(EmpirePowerBox.Text),
                GovernmentTypeId = int.Parse(GovIdBox.Text)
            };

            MessageOnException.Execute(() =>
            {
                _empiresManager.Add(empire);
                SetAlliancePower(null, null);
                SetEmpireNewName();
            });
        }
 private void UpdateGovId(object sender, RoutedEventArgs e)
 {
     MessageOnException.Execute(() => _empiresManager.SetGovId(GovId));
 }
 private void Commit(object sender, RoutedEventArgs e)
 {
     MessageOnException.Execute(() => _empiresManager.CommitTransaction());
 }
 private void UpdatePower(object sender, RoutedEventArgs e)
 {
     MessageOnException.Execute(() => _empiresManager.SetPower(Power));
 }
 private void BeginTransaction(object sender, RoutedEventArgs e)
 {
     MessageOnException.Execute(() => _empiresManager.BeginTransaction(IsolationLevel.ReadUncommitted));
 }
Example #11
0
 private void RollbackTransaction(object sender, RoutedEventArgs e)
 {
     MessageOnException.Execute(() => _empiresManager.Rollback());
 }
Example #12
0
 private void RollbackToSavePoint(object sender, RoutedEventArgs e)
 {
     MessageOnException.Execute(() => _empiresManager.Rollback(SavePointName));
 }
Example #13
0
 private void FetchSum(object sender, RoutedEventArgs e)
 {
     MessageOnException.Execute(() => SumOfPowersBlock.Text = _empiresManager.GetSumOfPowers().ToString());
 }
Example #14
0
        private void IncreasePower(object sender, RoutedEventArgs e)
        {
            var empire = (Empire)ToEmpireBox.SelectedItem;

            MessageOnException.Execute(() => _empiresManager.AddPower(empire.Id, Amount));
        }