/// <summary> /// Raises the <see cref="E:ClientSessionTerminated"/> event. /// </summary> /// <param name="args">The <see cref="LoginEventArgs"/> instance containing the event data.</param> protected void OnClientSessionTerminated(LoginEventArgs args) { if (ClientSessionTerminated != null) { // fire event handlers asynchronously ThreadPool.QueueUserWorkItem(_ => { try { ClientSessionTerminated?.Invoke(this, args); } catch (Exception ex) { Trace.WriteLine("Warning: ClientSessionTerminated event handler has thrown" + " an exception of type {0}: {1} {2}", ex.GetType(), ex.Message, ex.StackTrace); } }); } }
/// <summary> /// Fires "ClientSessionTerminated" event. /// </summary> /// <param name="e">Arguments</param> protected internal void OnClientSessionTerminated(LoginEventArgs e) { ClientSessionTerminated?.Invoke(this, e); }