private void 除OToolStripButton_Click(object sender, EventArgs e) { if (curApp != null && MessageBox.Show("确定要删除当前应用信息?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { AppInfoMgr.Delete(curApp); tscmbAppInfo.Items.Remove(curApp); } }
private void tsbSaveInfo_Click(object sender, EventArgs e) { if (curApp != null) { curApp.应用名称 = tbAppName.Text; } AppInfoMgr.SaveAppInfo(); }
private void FrmAppInfoMgr_FormClosing(object sender, FormClosingEventArgs e) { if (curApp != null) { curApp.应用名称 = tbAppName.Text; } AppInfoMgr.SaveAppInfo(); }
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { AppInfo app = dataGridView1.CurrentRow.DataBoundItem as AppInfo; if (app != null && !string.IsNullOrEmpty(app.ExeFile) && e.ColumnIndex == 1) { this.WindowState = FormWindowState.Minimized; AppInfoMgr.StartApp(app); } }
private void TsmiChangeSetting_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e) { AppSetting appSetting = e.ClickedItem.Tag as AppSetting; AppInfo app = dataGridView1.CurrentRow.DataBoundItem as AppInfo; if (app != null && appSetting != null) { app.ChangeTo(appSetting); AppInfoMgr.SaveAppInfo(); } dataGridView1.Refresh(); }
private void 新建NToolStripButton_Click(object sender, EventArgs e) { openFileDialog1.InitialDirectory = ""; openFileDialog1.Filter = "可执行文件(*.exe)|*.exe|所有文件|*.*"; openFileDialog1.Multiselect = false; openFileDialog1.FileName = ""; if (openFileDialog1.ShowDialog() == DialogResult.OK) { Clear(); AppInfo app = AppInfoMgr.Add(openFileDialog1.FileName); tscmbAppInfo.Items.Add(app); tscmbAppInfo.SelectedIndex = tscmbAppInfo.Items.Count - 1; DisplayAppInfo(); } }