コード例 #1
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);
            }
        }
コード例 #2
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();
        }
コード例 #3
0
        public DataInputTomeScreenClass()
        {
            InitializeComponent();

            Model = new TomeModel();

            //populate the list of abilty and skill names
            AbilityNames = AbilityModel.GetNames();
            SkillNames   = SkillModel.GetNames();

            foreach (string Name in AbilityNames)
            {
                ModifierListBox.Items.Add(Name);
            }

            //populate the tome list box
            TomeListNames = TomeModel.GetNames();
            foreach (string Name in TomeListNames)
            {
                TomeListBox.Items.Add(Name);
            }
        }
コード例 #4
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;
        }
コード例 #5
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();
        }