private void SkillsDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            CharacterSkill cs = (CharacterSkill)SkillsDataGrid.SelectedItem;

            DescriptionTextBox.Document.Blocks.Clear();
            DescriptionTextBox.Document.Blocks.AddRange(cs.Description);
        }
Exemplo n.º 2
0
        public void LoadCharSkills(XElement el, ref CharacterSheetData csd)
        {
            IEnumerable <XElement> nodes = el.Descendants();

            foreach (XElement xe in nodes)
            {
                CharacterSkill skill = csd.Skills.First(s => s.SkillName == xe.Name.LocalName);
                if (skill != null)
                {
                    int i = csd.Skills.IndexOf(skill);
                    csd.Skills[i].BaseSkillValue = (int)xe;
                }
            }
        }
Exemplo n.º 3
0
        private CharacterSkill LoadSkill(XElement el)
        {
            CharacterSkill         skill = new CharacterSkill();
            IEnumerable <XElement> nodes = el.Descendants();

            foreach (XElement xe in nodes)
            {
                switch (xe.Name.LocalName)
                {
                case "Name":
                    skill.SkillName = (string)xe;
                    break;

                case "DisplayName":
                    skill.SkillDisplayName = (string)xe;
                    break;

                case "GoverningAbilityScore":
                    skill.GoverningAbilityScore = (string)xe;
                    break;

                case "AppliesArmorCheckPenalty":
                    skill.AppliesArmorCheckPenalty = (bool)xe;
                    break;

                case "TrainedOnly":
                    skill.TrainedOnly = (bool)xe;
                    break;

                case "IsCraftSkill":
                    skill.IsCraftSkill = (bool)xe;
                    break;

                case "IsProfession":
                    skill.IsProfession = (bool)xe;
                    break;

                case "Description":
                    skill.Description = TextBlocktoParagraphs(xe);
                    break;
                }
            }
            return(skill);
        }