コード例 #1
0
 private void PopulateFeatListBox()
 {
     FeatNames = FeatModel.GetNames();
     foreach (string name in FeatNames)
     {
         FeatListBox.Items.Add(name);
     }
 }
コード例 #2
0
 private void PopulatePastLifeFeatComboBoxList()
 {
     FeatNames = FeatModel.GetNames();
     PastLifeFeatCombo.Items.Add("");
     foreach (string name in FeatNames)
     {
         PastLifeFeatCombo.Items.Add(name);
     }
 }
コード例 #3
0
        private void FillcomboModifier()
        {
            string categoryName;

            categoryName = comboCategory.SelectedItem.ToString();
            ModifierNames.Clear();
            comboModifier.Items.Clear();

            if (categoryName == "Ability")
            {
                labelModifier.Text = "Select an Ability";
                ModifierNames      = AbilityModel.GetNames();
            }
            else if (categoryName == "Attribute")
            {
                labelModifier.Text = "Select an Attribute";
                ModifierNames      = AttributeModel.GetNames();
            }
            else if (categoryName == "Feat")
            {
                labelModifier.Text = "Select a Feat";
                ModifierNames      = FeatModel.GetNames();
            }
            else if (categoryName == "Save")
            {
                labelModifier.Text = "Select a Save";
                ModifierNames      = SaveModel.GetNames();
            }
            else if (categoryName == "Skill")
            {
                labelModifier.Text = "Select a Skill";
                ModifierNames      = SkillModel.GetNames();
            }
            else if (categoryName == "Spell")
            {
                labelModifier.Text = "Select a Spell";
                ModifierNames      = SpellModel.GetNames();
            }
            else
            {
                //We should never reach this, if so, we need to add a category of fix one.
                Debug.WriteLine("Error: no category exist for the selected. ModifierDialogClass::FillcomboModifier()");
                return;
            }

            foreach (string name in ModifierNames)
            {
                comboModifier.Items.Add(name);
            }
        }
コード例 #4
0
        private void PopulateData()
        {
            // Generate our lists that will be used for our comboboxes.
            FeatNames = FeatModel.GetNames();
            Levels.Clear();
            for (int i = 1; i <= Constant.MaxLevels; i++)
            {
                if (i > Constant.NumHeroicLevels && MainScreen != ScreenType.Character)
                {
                    break;
                }
                Levels.Add(i.ToString());
            }

            //Get our model data and record count
            switch (MainScreen)
            {
            case ScreenType.Character:
            {
                CharacterFeatModel = CharacterBonusFeatModel.GetAll();
                RecordCount        = CharacterFeatModel.Count;
                break;
            }

            case ScreenType.Class:
            {
                ClassFeatModel = ClassBonusFeatModel.GetAll(MainRecordId);
                RecordCount    = ClassFeatModel.Count;
                break;
            }

            case ScreenType.Race:
            {
                RaceFeatModel = RaceBonusFeatModel.GetAll(MainRecordId);
                RecordCount   = RaceFeatModel.Count;
                break;
            }
            }

            //Set our tracking variables to false.
            HasDataChanged.Clear();
            RecordDeleted.Clear();
            for (int i = 0; i < RecordCount; i++)
            {
                HasDataChanged.Add(false);
                RecordDeleted.Add(false);
            }
        }
コード例 #5
0
        private void CategoryComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            string category;

            category = CategoryComboBox.SelectedItem.ToString();

            ApplyToNames.Clear();
            if (category == "Ability")
            {
                ApplyToLabel.Text = "Select an Ability";
                ApplyToNames      = AbilityModel.GetNames();
            }
            else if (category == "Attribute")
            {
                ApplyToLabel.Text = "Select an Attribute";
                ApplyToNames      = AttributeModel.GetNames();
            }
            else if (category == "Feat")
            {
                ApplyToLabel.Text = "Select a Feat";
                ApplyToNames      = FeatModel.GetNames();
            }
            else if (category == "Save")
            {
                ApplyToLabel.Text = "Select a Save";
                ApplyToNames      = SaveModel.GetNames();
            }
            else if (category == "Skill")
            {
                ApplyToLabel.Text = "Select a Skill";
                ApplyToNames      = SkillModel.GetNames();
            }
            else if (category == "Spell")
            {
                ApplyToLabel.Text = "Select a spell";
                ApplyToNames      = SpellModel.GetNames();
            }
            else
            {
                Debug.WriteLine("Error: No category exists for the one selected. NewModifierDialogClass : CategoryComboBox_SelectedIndexChanged()");
                return;
            }
            FillApplyToComboBox();
            UpdateNameField();
        }
コード例 #6
0
        /// <summary>
        /// Temporary method to strip our current feat Description of the HTML tags that are no longer needed.
        /// </summary>
        public static void FixFeatDescriptions()
        {
            int           count;
            FeatModel     model;
            List <string> featNames;
            string        newDescription;

            featNames = FeatModel.GetNames();
            count     = featNames.Count();
            //count = 1;
            for (int i = 0; i < count; i++)
            {
                model = new FeatModel();
                model.Initialize(featNames[i]);
                if (model.Description != null)
                {
                    newDescription    = StripHTMLfromOldDescriptions(model.Description);
                    model.Description = newDescription;
                    model.Save();
                }
            }
        }
コード例 #7
0
        private void comboCategory_SelectedIndexChanged(object sender, EventArgs e)
        {
            string categoryName;

            categoryName = comboCategory.SelectedItem.ToString();

            ApplyToNames.Clear();
            comboApplyTo.Items.Clear();
            comboTree.Items.Clear();
            //resize our form
            this.Size = new Size(DefaultWidth, DefaultHeight);
            //hide our optional controls
            labelTree.Visible = false;
            comboTree.Visible = false;
            labelSlot.Visible = false;
            comboSlot.Visible = false;

            if (categoryName == "Ability")
            {
                ApplyToNames      = AbilityModel.GetNames();
                labelApplyTo.Text = "Select an Ability";
            }

            else if (categoryName == "Alignments")
            {
                ApplyToNames      = AlignmentModel.GetNames();
                labelApplyTo.Text = "Select an Alignment";
            }
            else if (categoryName == "Attribute")
            {
                ApplyToNames      = AttributeModel.GetNames();
                labelApplyTo.Text = "Select an Attribute";
            }

            else if (categoryName == "Character")
            {
                ApplyToNames.Add("Level");
                labelApplyTo.Text = "Select Character Property";
            }

            else if (categoryName == "Class")
            {
                ApplyToNames      = ClassModel.GetNames();
                labelApplyTo.Text = "Select a Class";
            }

            else if (categoryName == "Enhancement")
            {
                //lets resie our form to make room for other controls
                this.Size         = new Size(DefaultWidth, DefaultHeight + 99);
                labelTree.Visible = true;
                comboTree.Visible = true;
                labelSlot.Visible = true;
                comboSlot.Visible = true;
                TreeNames         = EnhancementTreeModel.GetNames();
                foreach (string name in TreeNames)
                {
                    comboTree.Items.Add(name);
                }
                labelApplyTo.Text = "Select an Enhancement";
                buttonOk.Enabled  = false;
                return;
            }

            else if (categoryName == "EnhancementSlot")
            {
                //lets resize our form to make room for other controls
                this.Size         = new Size(DefaultWidth, DefaultHeight + 47);
                labelTree.Visible = true;
                comboTree.Visible = true;
                TreeNames         = EnhancementTreeModel.GetNames();
                foreach (string name in TreeNames)
                {
                    comboTree.Items.Add(name);
                }
                labelApplyTo.Text = "Select an Enhancement Slot";
                buttonOk.Enabled  = false;
                return;
            }

            else if (categoryName == "Feat")
            {
                ApplyToNames      = FeatModel.GetNames();
                labelApplyTo.Text = "Select a Feat";
            }

            else if (categoryName == "Race")
            {
                ApplyToNames      = RaceModel.GetNames();
                labelApplyTo.Text = "Select a Race";
            }

            else if (categoryName == "Skill")
            {
                ApplyToNames      = SkillModel.GetNames();
                labelApplyTo.Text = "Select a Skill";
            }

            else
            {
                Debug.WriteLine("Error: No category exists for the one selected. RequirementDialogClass : comboCategory_SelectedIndexChanged()");
                return;
            }

            foreach (string name in ApplyToNames)
            {
                comboApplyTo.Items.Add(name);
            }
            buttonOk.Enabled = false;
        }
コード例 #8
0
        private void CategoryComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            string category;

            category = CategoryComboBox.SelectedItem.ToString();

            ApplyToNames.Clear();
            ApplyToComboBox.Items.Clear();
            TreeComboBox.Items.Clear();
            //Lets set the default size of our form
            this.Size = new Size(DefaultWidth, DefaultHeight);
            //Hide our optional controls
            TreeLabel.Visible    = false;
            TreeComboBox.Visible = false;
            SlotLabel.Visible    = false;
            SlotComboBox.Visible = false;

            if (category == "Ability")
            {
                ApplyToNames      = AbilityModel.GetNames();
                ApplyToLabel.Text = "Select an Ability";
            }

            else if (category == "Attribute")
            {
                ApplyToNames      = AttributeModel.GetNames();
                ApplyToLabel.Text = "Select an Attribute";
            }

            else if (category == "Class")
            {
                ApplyToNames      = ClassModel.GetNames();
                ApplyToLabel.Text = "Select a Class";
            }

            else if (category == "Enhancement")
            {
                //Lets resize our form to make room for other controls
                this.Size            = new Size(DefaultWidth + 100, DefaultHeight + 94);
                TreeLabel.Visible    = true;
                TreeComboBox.Visible = true;
                SlotLabel.Visible    = true;
                SlotComboBox.Visible = true;
                TreeNames            = EnhancementTreeModel.GetNames();
                foreach (string name in TreeNames)
                {
                    TreeComboBox.Items.Add(name);
                }
                ApplyToLabel.Text = "Select an Enhancement";
                UpdateNameField();
                return;
            }

            else if (category == "EnhancementSlot")
            {
                //Lets resize our form to make room for other controls
                this.Size            = new Size(DefaultWidth + 100, DefaultHeight + 42);
                TreeLabel.Visible    = true;
                TreeComboBox.Visible = true;
                TreeNames            = EnhancementTreeModel.GetNames();
                foreach (string name in TreeNames)
                {
                    TreeComboBox.Items.Add(name);
                }
                ApplyToLabel.Text = "Select An Enhancement Slot";
                UpdateNameField();
                return;
            }
            else if (category == "Feat")
            {
                ApplyToNames      = FeatModel.GetNames();
                ApplyToLabel.Text = "Select a Feat";
            }

            else if (category == "Race")
            {
                ApplyToNames      = RaceModel.GetNames();
                ApplyToLabel.Text = "Select a Race";
            }

            else if (category == "Skill")
            {
                ApplyToNames      = SkillModel.GetNames();
                ApplyToLabel.Text = "Select a Skill";
            }

            else
            {
                Debug.WriteLine("Error: No category exists for the one selected. NewRequirementDialogClass : CategoryComboBox_SelectedIndexChanged()");
                return;
            }

            foreach (string name in ApplyToNames)
            {
                ApplyToComboBox.Items.Add(name);
            }

            UpdateNameField();
        }
コード例 #9
0
 public FeatDataCollectionClass()
 {
     FeatNames = FeatModel.GetNames();
     LoadFeatIds();
 }