Skip to content

Commit

Permalink
[BUG] Fix a rare exception when moving trough menu by keyboard and ex…
Browse files Browse the repository at this point in the history
…ecute file (#240), version 1.0.27.3
  • Loading branch information
Hofknecht committed Nov 17, 2021
1 parent 7f4266f commit 69e8cf4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
21 changes: 14 additions & 7 deletions Business/KeyboardInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ internal void CmdKeyProcessed(object sender, Keys keys)
{
case Keys.Enter:
SelectByKey(keys);
menus[iMenuKey].FocusTextBox();
menus[iMenuKey]?.FocusTextBox();
break;
case Keys.Left:
if (Properties.Settings.Default.AppearAtTheBottomLeft)
Expand Down Expand Up @@ -106,7 +106,7 @@ internal void CmdKeyProcessed(object sender, Keys keys)
SelectByKey(keys);
break;
case Keys.Control | Keys.F:
menus[iMenuKey].FocusTextBox();
menus[iMenuKey]?.FocusTextBox();
break;
case Keys.Tab:
{
Expand All @@ -123,7 +123,7 @@ internal void CmdKeyProcessed(object sender, Keys keys)
indexNew = indexMax;
}

menus[indexNew].FocusTextBox();
menus[indexNew]?.FocusTextBox();
}

break;
Expand All @@ -142,13 +142,13 @@ internal void CmdKeyProcessed(object sender, Keys keys)
indexNew = 0;
}

menus[indexNew].FocusTextBox();
menus[indexNew]?.FocusTextBox();
}

break;
case Keys.Apps:
{
DataGridView dgv = menus[iMenuKey].GetDataGridView();
DataGridView dgv = menus[iMenuKey]?.GetDataGridView();

if (iRowKey > -1 &&
dgv.Rows.Count > iRowKey)
Expand Down Expand Up @@ -331,8 +331,15 @@ private void SelectByKey(Keys keys, string keyInput = "", bool keepSelection = f
ClosePressed?.Invoke();
}

// Raise Dgv_RowPostPaint to show ProcessStarted
dgv.InvalidateRow(iRowKey);
try
{
// Raise Dgv_RowPostPaint to show ProcessStarted
dgv.InvalidateRow(iRowKey);
}
catch (ArgumentOutOfRangeException ex)
{
Log.Warn("InvalidateRow failed", ex);
}
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion Config/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static void Dispose()
AppColors.BitmapFilesCount.Dispose();
}

internal static Icon GetAppIcon()
public static Icon GetAppIcon()
{
if (Settings.Default.UseIconFromRootFolder)
{
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.27.2")]
[assembly: AssemblyFileVersion("1.0.27.2")]
[assembly: AssemblyVersion("1.0.27.3")]
[assembly: AssemblyFileVersion("1.0.27.3")]

0 comments on commit 69e8cf4

Please sign in to comment.