// A method that rebuilds the page from the data gotten out of the session, it resets the colors of the borders to ---- // black, then goes through the list<string> and changes the color of the bordercolor to lime for each item in the ---- // list. --------------------------------------------------------------------------------------------------------------- private void Check() { int counter = 0; foreach (string item in Build) { if (myBuild.SelectedClass == null) { myBuild.AddClass(item); } else if (myBuild.SelectedSpec == null) { myBuild.AddSpec(item); } else if (myBuild.SelectedSpells.Count < 7) { myBuild.AddSpell(item, counter); counter++; } } }
// All buttons below here that have the name ibtnSpell# calls the method check, adds de selected spell to the instance - // from Build at the correct position,adds it to the session and calls the method to rebuild the pages with the new - // changes. ------------------------------------------------------------------------------------------------------------ protected void ibtnSpell1_Click(object sender, ImageClickEventArgs e) { Check(); myBuild.AddSpell("15", 0); Session.Add("Build", myBuild.UpdateBuild());; FillPage(); }