private void BtnLoad_Click(object sender, EventArgs e) { var form = new frmLoad(GetSaves().ToArray()); form.btnLoad.Click += (ls, le) => { if (form.lbSaves.SelectedIndex < 0) return; var saveName = form.lbSaves.SelectedItem as string; if (string.IsNullOrEmpty(saveName)) return; tab.ChangeVariablesList(variablesList = new VariablesList(savesPath, saveName)); form.Close(); }; form.ShowDialog(); }
private void BtnLoad_Click(object sender, EventArgs e) { var form = new frmLoad(GetSaves().ToArray()); form.btnLoad.Click += (ls, le) => { if (form.lbSaves.SelectedIndex < 0) { return; } var saveName = form.lbSaves.SelectedItem as string; if (string.IsNullOrEmpty(saveName)) { return; } tab.ChangeVariablesList(variablesList = new VariablesList(savesPath, saveName)); form.Close(); }; form.ShowDialog(); }