示例#1
0
        private void chkLst_Spells_Resources_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            string xmlPath = ((CheckBoxItems)chkLst_Spell_Resources.Items[e.Index]).path;

            Controllers.SpellController sController = new Controllers.SpellController(xmlPath);

            chkLst_Resources_ItemCheck(xmlPath, chkLst_Spell_list, sController.GetSpellList(), e.NewValue);
        }
示例#2
0
        private void chkLst_Spells_Selected_SelectedIndexChanged(object sender, EventArgs e)
        {
            Spell spell = new Spell();

            if (chkLst_Spell_list.SelectedItem != null)
            {
                CheckBoxItems selectedItem = ((CheckBoxItems)chkLst_Spell_list.SelectedItem);
                string        xmlPath      = selectedItem.path;
                Controllers.SpellController sController = new Controllers.SpellController(xmlPath);
                spell = sController.GetSpell(selectedItem.display);
            }
            pnl_Spell.SetValue(spell);
        }
示例#3
0
 public void Homebrewery(string fileName)
 {
     if (chkLst_Spell_list.CheckedItems != null)
     {
         StringBuilder sb = new StringBuilder();
         foreach (CheckBoxItems selectedItem in chkLst_Spell_list.CheckedItems)
         {
             string xmlPath = selectedItem.path;
             Controllers.SpellController sController = new Controllers.SpellController(xmlPath);
             Spell spell = sController.GetSpell(selectedItem.display);
             sb.AppendLine(spell.BuildHomebrewery());
         }
         System.IO.File.WriteAllText(fileName, sb.ToString());
     }
 }
示例#4
0
        public void Export(string fileName)
        {
            if (chkLst_Spell_list.CheckedItems != null)
            {
                DataTable dt = Spell.GenerateNewTable();
                foreach (CheckBoxItems selectedItem in chkLst_Spell_list.CheckedItems)
                {
                    string xmlPath = selectedItem.path;
                    Controllers.SpellController sController = new Controllers.SpellController(xmlPath);
                    Spell   spell = sController.GetSpell(selectedItem.display);
                    DataRow dr    = dt.NewRow();
                    spell.PopulateDataRow(ref dr);
                    dt.Rows.Add(dr);
                }

                DataSet ds = new DataSet();
                ds.Tables.Add(dt);

                DND.Controllers.ExcelController excel = new Controllers.ExcelController();
                excel.ExportDataSetToExcel(ds, fileName);
            }
        }