/// <summary> /// 保存xml /// </summary> /// <returns></returns> public static void Save <T>(IEnumerable <T> model) where T : class, new() { var xmlPath = string.Format("{0}.xml", typeof(T).Name); XmlHelper.Save(model, xmlPath); }
private void SaveToolStripMenuItem_Click(object sender, EventArgs e) { XmlHelper.Save <Clock>(ClockCaches.Select(item => item.Value)); MessageBox.Show("保存成功"); }