Ejemplo n.º 1
0
        private void SetSkills(object sender, ExecutedRoutedEventArgs e)
        {
            EndGnomeEdit();

            var dlg = new SkillDialog {
                Owner = this
            };
            var result = dlg.ShowDialog();

            if (result == false)
            {
                return;
            }

            int skillValue;

            Int32.TryParse(dlg.SkillValue.Text, out skillValue);

            if (dlg.MilitarySkills.IsChecked == true)
            {
                SelectedGnomeRows.ToList().ForEach(x => x.SetMilitarySkills(skillValue));
            }

            if (dlg.ProfessionSkills.IsChecked == true)
            {
                SelectedGnomeRows.ToList().ForEach(x => x.SetProfessionSkills(skillValue));
            }
            GnomeGrid.Items.Refresh();
        }
Ejemplo n.º 2
0
        private void SetEnemySkills(object sender, ExecutedRoutedEventArgs e)
        {
            var dlg = new SkillDialog {
                Owner = this, ProfessionSkills = { IsChecked = false, IsEnabled = false }
            };
            var result = dlg.ShowDialog();

            if (result == false)
            {
                return;
            }

            int skillValue;

            Int32.TryParse(dlg.SkillValue.Text, out skillValue);

            if (dlg.MilitarySkills.IsChecked == true)
            {
                SelectedEnemyRows.ToList().ForEach(x => x.SetMilitarySkills(skillValue));
            }

            EnemyGrid.Items.Refresh();
        }
Ejemplo n.º 3
0
        private void SetSkills(object sender, ExecutedRoutedEventArgs e)
        {
            EndGnomeEdit();

            var dlg = new SkillDialog { Owner = this };
            var result = dlg.ShowDialog();
            if (result == false)
            {
                return;
            }

            int skillValue;
            Int32.TryParse(dlg.SkillValue.Text, out skillValue);

            if (dlg.MilitarySkills.IsChecked == true)
            {
                SelectedGnomeRows.ToList().ForEach(x => x.SetMilitarySkills(skillValue));
            }

            if (dlg.ProfessionSkills.IsChecked == true)
            {
                SelectedGnomeRows.ToList().ForEach(x => x.SetProfessionSkills(skillValue));
            }
            GnomeGrid.Items.Refresh();
        }
Ejemplo n.º 4
0
        private void SetEnemySkills(object sender, ExecutedRoutedEventArgs e)
        {
            var dlg = new SkillDialog { Owner = this, ProfessionSkills = { IsChecked = false, IsEnabled = false } };
            var result = dlg.ShowDialog();
            if (result == false)
            {
                return;
            }

            int skillValue;
            Int32.TryParse(dlg.SkillValue.Text, out skillValue);

            if (dlg.MilitarySkills.IsChecked == true)
            {
                SelectedEnemyRows.ToList().ForEach(x => x.SetMilitarySkills(skillValue));
            }

            EnemyGrid.Items.Refresh();
        }