Merge pull request #8585 from ivandrofly/event-args

Replace new EventArgs() with EventArgs.Empty
This commit is contained in:
Nikolaj Olsson 2024-06-28 17:54:18 +02:00 committed by GitHub
commit baec5663b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 8 deletions

View File

@ -676,7 +676,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
{ {
// ignore // ignore
} }
OnVideoLoaded?.Invoke(_mediaPlayer, new EventArgs()); OnVideoLoaded?.Invoke(_mediaPlayer, EventArgs.Empty);
} }
public static string GetVlcPath(string fileName) public static string GetVlcPath(string fileName)
@ -1065,7 +1065,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
Stop(); Stop();
Play(); Play();
Pause(); Pause();
OnVideoEnded?.Invoke(_mediaPlayer, new EventArgs()); OnVideoEnded?.Invoke(_mediaPlayer, EventArgs.Empty);
} }
} }

View File

@ -144,7 +144,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
NativeMethods.libvlc_media_player_pause(_mediaPlayer); NativeMethods.libvlc_media_player_pause(_mediaPlayer);
_videoLoadedTimer.Stop(); _videoLoadedTimer.Stop();
OnVideoLoaded?.Invoke(_mediaPlayer, new EventArgs()); OnVideoLoaded?.Invoke(_mediaPlayer, EventArgs.Empty);
} }
public override void Initialize(Control ownerControl, string videoFileName, EventHandler onVideoLoaded, EventHandler onVideoEnded) public override void Initialize(Control ownerControl, string videoFileName, EventHandler onVideoLoaded, EventHandler onVideoEnded)
@ -195,7 +195,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
Stop(); Stop();
Play(); Play();
Pause(); Pause();
OnVideoEnded.Invoke(_mediaPlayer, new EventArgs()); OnVideoEnded.Invoke(_mediaPlayer, EventArgs.Empty);
} }
} }

View File

@ -186,7 +186,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC
} }
Resize(_initialWidth, _initialHeight); Resize(_initialWidth, _initialHeight);
OnVideoLoaded?.Invoke(this, new EventArgs()); OnVideoLoaded?.Invoke(this, EventArgs.Empty);
SendMpcMessage(MpcHcCommand.SetSubtitleTrack, "-1"); SendMpcMessage(MpcHcCommand.SetSubtitleTrack, "-1");
@ -209,7 +209,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC
} }
break; break;
case MpcHcCommand.NotifyEndOfStream: case MpcHcCommand.NotifyEndOfStream:
OnVideoEnded?.Invoke(this, new EventArgs()); OnVideoEnded?.Invoke(this, EventArgs.Empty);
break; break;
case MpcHcCommand.CurrentPosition: case MpcHcCommand.CurrentPosition:

View File

@ -249,7 +249,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
{ {
try try
{ {
OnVideoLoaded.Invoke(_quartzFilgraphManager, new EventArgs()); OnVideoLoaded.Invoke(_quartzFilgraphManager, EventArgs.Empty);
} }
catch catch
{ {
@ -266,7 +266,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
_isPaused = true; _isPaused = true;
if (OnVideoEnded != null && _quartzFilgraphManager != null) if (OnVideoEnded != null && _quartzFilgraphManager != null)
{ {
OnVideoEnded.Invoke(_quartzFilgraphManager, new EventArgs()); OnVideoEnded.Invoke(_quartzFilgraphManager, EventArgs.Empty);
} }
} }
} }