예제 #1
0
        private Guid GetApplyToId()
        {
            Guid   applyToId;
            string tableName;

            applyToId = Guid.Empty;
            tableName = comboCategory.SelectedItem.ToString();


            if (tableName == "Ability")
            {
                applyToId = AbilityModel.GetIdFromName(comboModifier.SelectedItem.ToString());
            }
            else if (tableName == "Attribute")
            {
                applyToId = AttributeModel.GetIdFromName(comboModifier.SelectedItem.ToString());
            }
            else if (tableName == "Feat")
            {
                applyToId = FeatModel.GetIdFromName(comboModifier.SelectedItem.ToString());
            }
            else if (tableName == "Save")
            {
                applyToId = SaveModel.GetIdFromName(comboModifier.SelectedItem.ToString());
            }
            else if (tableName == "Skill")
            {
                applyToId = SkillModel.GetIdFromName(comboModifier.SelectedItem.ToString());
            }
            else if (tableName == "Spell")
            {
                applyToId = SpellModel.GetIdFromName(comboModifier.SelectedItem.ToString());
            }
            else
            {
                //We should never reach this, if so, we need to add a category of fix one.
                Debug.WriteLine("Error: no category exists for the selected. ModifierDialogClass::GetApplyToId()");
                return(applyToId);
            }

            return(applyToId);
        }