This commit is contained in:
skidoodle 2024-03-13 00:33:46 +01:00
commit e124a47765
19374 changed files with 9806149 additions and 0 deletions

View file

@ -0,0 +1,107 @@
using System;
using Kreta.Framework.Security;
namespace Kreta.Framework.Session
{
/// <summary>
/// Provides data for the <see cref="SessionCreated" />, <see cref="SessionDeleted" />, <see cref="SessionActivated"/>, and <see cref="SessionDeactivated"/> events.
/// <see cref="SessionEventargs" /> is the base class for classes containing <see cref="UserContext"/> based session event data.
/// </summary>
public class SessionEventArgs : EventArgs
{
internal SessionEventArgs(LoginInfo loginInfo, string serverName)
{
SessionId = loginInfo.SessionID;
IntezmenyAzonosito = loginInfo.IntezmenyAzonosito;
UserUniqueIdentifier = loginInfo.UniqueIdentifier;
FelhasznaloId = loginInfo.FelhasznaloId;
GondviseloId = loginInfo.GondviseloId;
ClientIP = loginInfo.ClientIP;
ServerName = serverName;
}
public string IntezmenyAzonosito { get; protected set; }
/// <summary>
/// Gets the current session-identifier for the user
/// </summary>
public string SessionId { get; protected set; }
/// <summary>
/// Gets the globally unique user identifier for the user.
/// </summary>
public int UserUniqueIdentifier { get; protected set; }
/// <summary>
/// Gets the user related <see cref="IPAddress"/> information
/// </summary>
public string ClientIP { get; protected set; }
/// <summary>
/// Gets the local user identifier for the user.
/// </summary>
public int FelhasznaloId { get; protected set; }
public int? GondviseloId { get; protected set; }
/// <summary>
/// Gets the server identifier.
/// </summary>
public string ServerName { get; protected set; }
}
/// <summary>
/// Represents the delegate that will handle the <see cref="SessionCreated"/> event
/// </summary>
/// <param name="sender">The source of the event. When this event is raised by the <see cref="SessionManager"/> class, the sender is the object that raises the event.</param>
/// <param name="e">A <see cref="SessionEventArgs"/> instance that contains the event data.</param>
/// <remarks>
/// When you create a <see cref="SessionCreatedEventHandler" /> delegate, you identify the method that will handle the event.
/// To associate the event with your event handler, add an instance of the delegate to the event.
/// The event handler is called whenever the event occurs, unless you remove the delegate.
/// </remarks>
public delegate void SessionCreatedEventHandler(object sender, SessionEventArgs e);
/// <summary>
///
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="SessionEventArgs"/> instance containing the event data.</param>
public delegate void SessionAccessEventHandler(object sender, SessionEventArgs e);
/// <summary>
/// Represents the delegate that will handle the <see cref="SessionActivated"/> event
/// </summary>
/// <param name="sender">The source of the event. When this event is raised by the <see cref="SessionManager"/> class, the sender is the object that raises the event.</param>
/// <param name="e">A <see cref="SessionEventArgs"/> instance that contains the event data.</param>
/// <remarks>
/// When you create a <see cref="SessionActivatedEventHandler" /> delegate, you identify the method that will handle the event.
/// To associate the event with your event handler, add an instance of the delegate to the event.
/// The event handler is called whenever the event occurs, unless you remove the delegate.
/// </remarks>
public delegate void SessionActivatedEventHandler(object sender, SessionEventArgs e);
/// <summary>
/// Represents the delegate that will handle the <see cref="SessionDeactivated"/> event
/// </summary>
/// <param name="sender">The source of the event. When this event is raised by the <see cref="SessionManager"/> class, the sender is the object that raises the event.</param>
/// <param name="e">A <see cref="SessionEventArgs"/> instance that contains the event data.</param>
/// <remarks>
/// When you create a <see cref="SessionDeactivatedEventHandler" /> delegate, you identify the method that will handle the event.
/// To associate the event with your event handler, add an instance of the delegate to the event.
/// The event handler is called whenever the event occurs, unless you remove the delegate.
/// </remarks>
public delegate void SessionDeactivatedEventHandler(object sender, SessionEventArgs e);
/// <summary>
/// Represents the delegate that will handle the <see cref="SessionDeleted"/> event
/// </summary>
/// <param name="sender">The source of the event. When this event is raised by the <see cref="SessionManager"/> class, the sender is the object that raises the event.</param>
/// <param name="e">A <see cref="SessionEventArgs"/> instance that contains the event data.</param>
/// <remarks>
/// When you create a <see cref="SessionDeletedEventHandler" /> delegate, you identify the method that will handle the event.
/// To associate the event with your event handler, add an instance of the delegate to the event.
/// The event handler is called whenever the event occurs, unless you remove the delegate.
/// </remarks>
public delegate void SessionDeletedEventHandler(object sender, SessionEventArgs e);
}