private void But_DeleteApp_Click(object sender, EventArgs e) { if (MessageBox.Show("是否删除应用" + lst_Apps.SelectedItem.ToString(), "提示", MessageBoxButtons.YesNo) == DialogResult.Yes) { apps.RemoveAt(lst_Apps.SelectedIndex); DataEdit.WriteApps(apps, datapath); //保存 ReFresh(); } }
private void But_AddApp_Click(object sender, EventArgs e) { frm_Edit frm_Edit = new frm_Edit(); frm_Edit.ShowDialog(); if (CommunicateValue.changed_app != null) { apps.Add(CommunicateValue.changed_app); DataEdit.WriteApps(apps, datapath); //保存 CommunicateValue.changed_app = null; //重置 ReFresh(); } }
private void But_EditApp_Click(object sender, EventArgs e) { int index = lst_Apps.SelectedIndex; frm_Edit frm_Edit = new frm_Edit(apps[index]); frm_Edit.ShowDialog(); if (CommunicateValue.changed_app != null) { apps[index].Name = CommunicateValue.changed_app.Name; apps[index].Path = CommunicateValue.changed_app.Path; DataEdit.WriteApps(apps, datapath); CommunicateValue.changed_app = null; ReFresh(); } }
private void Frm_Main_Load(object sender, EventArgs e) { apps = DataEdit.ReadApps(datapath); ReFresh(); }