private void button3_Click(object sender, EventArgs e) { var items = listView1.SelectedItems; if (items.Count == 0) { return; } var item = items[0]; Model.ConfigNameSpace cns = GetModel(); if (cns != null) { if (config_nameSpace.Save(cns, item.SubItems[0].Text)) { MessageBox.Show("保存成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); ShowList(); } else { MessageBox.Show("保存失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } } }