aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Session/SessionManager.cs
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2018-12-28 15:21:02 +0100
committerVasily <JustAMan@users.noreply.github.com>2019-01-05 01:49:52 +0300
commit391b48614d598b5fbfad68b610520a5ae7a57b70 (patch)
treead5f23fcd90a22e0f986bff7aaa65eae5c73ed95 /Emby.Server.Implementations/Session/SessionManager.cs
parente4a041b8321e49fd9b21fb0f890caf23d4752212 (diff)
Remove FireEventIfNotNull
It's a pretty useless "helper" class
Diffstat (limited to 'Emby.Server.Implementations/Session/SessionManager.cs')
-rw-r--r--Emby.Server.Implementations/Session/SessionManager.cs19
1 files changed, 8 insertions, 11 deletions
diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs
index 2b2b3c677..eeb15b305 100644
--- a/Emby.Server.Implementations/Session/SessionManager.cs
+++ b/Emby.Server.Implementations/Session/SessionManager.cs
@@ -255,11 +255,10 @@ namespace Emby.Server.Implementations.Session
if ((activityDate - lastActivityDate).TotalSeconds > 10)
{
- EventHelper.FireEventIfNotNull(SessionActivity, this, new SessionEventArgs
+ SessionActivity?.Invoke(this, new SessionEventArgs
{
SessionInfo = session
-
- }, _logger);
+ });
}
return session;
@@ -693,7 +692,7 @@ namespace Emby.Server.Implementations.Session
}
}
- EventHelper.FireEventIfNotNull(PlaybackProgress, this, new PlaybackProgressEventArgs
+ PlaybackProgress?.Invoke(this, new PlaybackProgressEventArgs
{
Item = libraryItem,
Users = users,
@@ -707,8 +706,7 @@ namespace Emby.Server.Implementations.Session
PlaySessionId = info.PlaySessionId,
IsAutomated = isAutomated,
Session = session
-
- }, _logger);
+ });
if (!isAutomated)
{
@@ -1399,7 +1397,7 @@ namespace Emby.Server.Implementations.Session
if (result == null)
{
- EventHelper.FireEventIfNotNull(AuthenticationFailed, this, new GenericEventArgs<AuthenticationRequest>(request), _logger);
+ AuthenticationFailed?.Invoke(this, new GenericEventArgs<AuthenticationRequest>(request));
throw new SecurityException("Invalid user or password entered.");
}
@@ -1424,7 +1422,7 @@ namespace Emby.Server.Implementations.Session
ServerId = _appHost.SystemId
};
- EventHelper.FireEventIfNotNull(AuthenticationSucceeded, this, new GenericEventArgs<AuthenticationResult>(returnResult), _logger);
+ AuthenticationSucceeded?.Invoke(this, new GenericEventArgs<AuthenticationResult>(returnResult));
return returnResult;
}
@@ -1587,11 +1585,10 @@ namespace Emby.Server.Implementations.Session
if (saveCapabilities)
{
- EventHelper.FireEventIfNotNull(CapabilitiesChanged, this, new SessionEventArgs
+ CapabilitiesChanged?.Invoke(this, new SessionEventArgs
{
SessionInfo = session
-
- }, _logger);
+ });
try
{