private void btn_Save_Click(object sender, EventArgs e) { var button = (KryptonButton)sender; if (button.Name.Contains("player")) { XmlReader.SaveEncounter(Utillities.SaveFileLocation("Xml Files(.xml) | *.xml"), Utillities.playerTable); } if (button.Name.Contains("monster")) { XmlReader.SaveEncounter(Utillities.SaveFileLocation("Xml Files(.xml) | *.xml"), Utillities.monsterPoolTable); } }