private void delete_button_Click(object sender, EventArgs e) { if (_SelectedHpkInstall == null || _selectedRow == null) { return; } string name = string.Empty; string uuid = string.Empty; string path = string.Empty; var row = hpkInstallGridView.CurrentRow; if (row == null) { return; } name = row.Cells[0].Value.ToString(); uuid = row.Cells[1].Value.ToString(); path = row.Cells[2].Value.ToString(); _SelectedHpkInstall = _hpkInstallList.InstallFileList.FirstOrDefault(x => x.PackageName == name && x.Uuid == uuid && x.FilePath == path); _viewList.Remove(_viewList.FirstOrDefault(x => x.PackageName == _SelectedHpkInstall.PackageName && x.Uuid == _SelectedHpkInstall.Uuid && x.FilePath == _SelectedHpkInstall.FilePath)); _hpkInstallList.InstallFileList.Remove(_SelectedHpkInstall); _SelectedHpkInstall = null; _selectedRow = null; hpkInstallTableDataBindingSource.ResetBindings(false); validate_configurationData(); }
private void PopulateHpkInstallOptions(object sender, EventArgs e) { var row = hpkInstallGridView.CurrentRow; if (row == null) { return; } var name = row.Cells[0].Value.ToString(); var uuid = row.Cells[1].Value.ToString(); var path = row.Cells[2].Value.ToString(); _selectedRow = _viewList.FirstOrDefault(x => x.PackageName == name && x.Uuid == uuid && x.FilePath == path); _SelectedHpkInstall = _hpkInstallList.InstallFileList.FirstOrDefault(x => x.PackageName == name && x.Uuid == uuid && x.FilePath == path); }