Minor refact

This commit is contained in:
Nikolaj Olsson 2024-06-05 07:35:48 +02:00
parent 7b75b154ef
commit 998ee5ca95

View File

@ -394,8 +394,8 @@ namespace Nikse.SubtitleEdit.Controls
_setLastColumnWidthTimer.Stop();
if (Columns.Count > 0)
{
int width = 0;
for (int i = 0; i < Columns.Count - 1; i++)
var width = 0;
for (var i = 0; i < Columns.Count - 1; i++)
{
width += Columns[i].Width;
}
@ -521,7 +521,7 @@ namespace Nikse.SubtitleEdit.Controls
{
var stringFormat = new StringFormat
{
FormatFlags = (StringFormatFlags)0,
FormatFlags = 0,
Alignment = StringAlignment.Near,
LineAlignment = StringAlignment.Near,
HotkeyPrefix = HotkeyPrefix.None,
@ -2391,15 +2391,9 @@ namespace Nikse.SubtitleEdit.Controls
if (disposing)
{
// unhook handler
_setLastColumnWidthTimer.Tick -= SetLastColumnWidthTimer_Tick;
_syntaxColorLineTimer.Tick -= SyntaxColorLineTimerTick;
_setStartAndDurationTimer.Tick -= SetStartAndDurationTimerTick;
// dispose timers
_setLastColumnWidthTimer.Dispose();
_syntaxColorLineTimer.Dispose();
_setStartAndDurationTimer.Dispose();
_setLastColumnWidthTimer?.Dispose();
_syntaxColorLineTimer?.Dispose();
_setStartAndDurationTimer?.Dispose();
}
}
}