Skip to content

Commit 26a88f8

Browse files
committed
Minor tweaks in prep for 2.2.0.0 release
1 parent ee6b3ae commit 26a88f8

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

Forms/KeyCaptureConfig.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,11 @@ private void btnStart_Click(object sender, EventArgs e)
331331
case CaptureMessage.InputMissing:
332332
case CaptureMessage.InputZero:
333333
default:
334-
#warning should this show a message box?
335-
Console.WriteLine("Error: " + eReturn);
334+
MessageBox.Show(
335+
"Failed to initialize key capture. Exited with error code: {0}".FormatString(eReturn),
336+
"Key Capture Failed",
337+
MessageBoxButtons.OK,
338+
MessageBoxIcon.Error);
336339
ConfigureControlsForCapture(false);
337340
break;
338341
}

Support/IO/INIManager.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,13 @@ public void FlushIniSettings()
187187

188188
try
189189
{
190-
var zWriter = new StreamWriter(Filename, false);
191-
192-
foreach (var sKey in m_dictionaryItems.Keys)
190+
using (var zWriter = new StreamWriter(Filename, false))
193191
{
194-
zWriter.WriteLine(sKey + CHAR_SPLITTER + m_dictionaryItems[sKey]);
192+
foreach (var sKey in m_dictionaryItems.Keys)
193+
{
194+
zWriter.WriteLine(sKey + CHAR_SPLITTER + m_dictionaryItems[sKey]);
195+
}
195196
}
196-
zWriter.Close();
197197
}
198198
#warning do nothing?
199199
catch (Exception)

0 commit comments

Comments
 (0)