From 998ee5ca951205edfaf5388d40dbdde46ce226a4 Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Wed, 5 Jun 2024 07:35:48 +0200 Subject: [PATCH] Minor refact --- src/ui/Controls/SubtitleListView.cs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/ui/Controls/SubtitleListView.cs b/src/ui/Controls/SubtitleListView.cs index 99890dae9..2facd79f7 100644 --- a/src/ui/Controls/SubtitleListView.cs +++ b/src/ui/Controls/SubtitleListView.cs @@ -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(); } } }