private void btnUseTemplate_Click(object sender, EventArgs e) { string file = (string)lstTemplates.SelectedItem; if (string.IsNullOrEmpty(file)) { MessageBox.Show("Please choose a template."); return; } XmlSerializer serializer = new XmlSerializer(typeof(RTEmail)); RTEmail email; using (TextReader textReader = new StreamReader(Path.Combine(RTSettings.GetTemplateDirectory(), file + RTSettings.TemplateFileType))) { using (XmlReader xmlReader = XmlReader.Create(textReader)) { email = (RTEmail)serializer.Deserialize(xmlReader); } } using (TicketForm frm = new TicketForm()) { frm.LoadTicket(email); if (frm.CreatedTemplates) { LoadTemplateList(); } } }
private void btnNoTemplate_Click(object sender, EventArgs e) { using (TicketForm frm = new TicketForm()) { RTEmail email = new RTEmail(); frm.LoadTicket(email); if (frm.CreatedTemplates) { LoadTemplateList(); } } }