private void listPatches_SelectedIndexChanged(object sender, EventArgs e)
{
if (listPatches.SelectedItems.Count > 0)
{
int index = listPatches.SelectedIndex;
if (patches.PatchList.ElementAtOrDefault(listPatches.SelectedIndex) != null)
{
txtPatchTitle.Text = patches.PatchList[index].title;
txtPatchAuthor.Text = patches.PatchList[index].author;
txtPatchDescription.Text = patches.PatchList[index].description;
txtPatternBytesSearch.Text = patches.PatchList[index].pattern;
txtPatternMatch.Text = patches.PatchList[index].match;
txtPatternOffset.Text = patches.PatchList[index].offset.ToString();
txtBytesToPatch.Text = patches.PatchList[index].patch;
chkPatchReplaceAll.Checked = patches.PatchList[index].recursivePatch;
chkRunOnStartup.Checked = patches.PatchList[index].patchOnStartup;
chkPatchBeforeStartup.Checked = patches.PatchList[index].patchBeforeStartup;
grpPatch.Enabled = true;
grpPatchInfo.Enabled = true;
grpPatchResults.Enabled = true;
grpScanBytes.Enabled = true;
btnPatchSave.Enabled = true;
btnDeletePatch.Enabled = true;
}
listPatternResults.Items.Clear();
}
}