public void ChangeTicket(string nam, TicketList list) { Ticket a = null; foreach (Ticket t in list.Items) { if (t.name == nam) { a = t; oldstate = a.mystate; break; } } if (a != null) { DialogResult dr = Open(a.name, a.assign, a.description, a.created); if (dr == DialogResult.OK) { list.Items.Remove(a); list.Items.Add(new Ticket(name, des, oldstate, assign, cr)); } if (dr == DialogResult.No) { list.Items.Remove(a); } } }
void Loading() { StreamReader sr = new StreamReader(File.OpenRead(Path.Combine(Application.StartupPath, ".tm"))); string Read = sr.ReadToEnd().Replace(Environment.NewLine, String.Empty);; sr.Close(); tickets = FromXML(Read); }
public string ToXML(TicketList obj) { using (StringWriter stringWriter = new StringWriter(new StringBuilder())) { XmlSerializer xmlSerializer = new XmlSerializer(typeof(TicketList)); xmlSerializer.Serialize(stringWriter, obj); return(stringWriter.ToString()); } }