mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-25 18:16:56 +01:00
extracted more logging dependancies
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using MediaBrowser.Common.Logging;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -10,18 +9,14 @@ namespace MediaBrowser.Common.Events
|
||||
/// </summary>
|
||||
public static class EventHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// The logger
|
||||
/// </summary>
|
||||
private static readonly ILogger Logger = LogManager.GetLogger("EventHelper");
|
||||
|
||||
/// <summary>
|
||||
/// Fires the event.
|
||||
/// </summary>
|
||||
/// <param name="handler">The handler.</param>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param>
|
||||
public static void QueueEventIfNotNull(EventHandler handler, object sender, EventArgs args)
|
||||
/// <param name="logger">The logger.</param>
|
||||
public static void QueueEventIfNotNull(EventHandler handler, object sender, EventArgs args, ILogger logger)
|
||||
{
|
||||
if (handler != null)
|
||||
{
|
||||
@@ -33,7 +28,7 @@ namespace MediaBrowser.Common.Events
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error in event handler", ex);
|
||||
logger.ErrorException("Error in event handler", ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -46,7 +41,8 @@ namespace MediaBrowser.Common.Events
|
||||
/// <param name="handler">The handler.</param>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="args">The args.</param>
|
||||
public static void QueueEventIfNotNull<T>(EventHandler<T> handler, object sender, T args)
|
||||
/// <param name="logger">The logger.</param>
|
||||
public static void QueueEventIfNotNull<T>(EventHandler<T> handler, object sender, T args, ILogger logger)
|
||||
{
|
||||
if (handler != null)
|
||||
{
|
||||
@@ -58,7 +54,7 @@ namespace MediaBrowser.Common.Events
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error in event handler", ex);
|
||||
logger.ErrorException("Error in event handler", ex);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -70,7 +66,8 @@ namespace MediaBrowser.Common.Events
|
||||
/// <param name="handler">The handler.</param>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param>
|
||||
public static void FireEventIfNotNull(EventHandler handler, object sender, EventArgs args)
|
||||
/// <param name="logger">The logger.</param>
|
||||
public static void FireEventIfNotNull(EventHandler handler, object sender, EventArgs args, ILogger logger)
|
||||
{
|
||||
if (handler != null)
|
||||
{
|
||||
@@ -80,7 +77,7 @@ namespace MediaBrowser.Common.Events
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error in event handler", ex);
|
||||
logger.ErrorException("Error in event handler", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -92,7 +89,8 @@ namespace MediaBrowser.Common.Events
|
||||
/// <param name="handler">The handler.</param>
|
||||
/// <param name="sender">The sender.</param>
|
||||
/// <param name="args">The args.</param>
|
||||
public static void FireEventIfNotNull<T>(EventHandler<T> handler, object sender, T args)
|
||||
/// <param name="logger">The logger.</param>
|
||||
public static void FireEventIfNotNull<T>(EventHandler<T> handler, object sender, T args, ILogger logger)
|
||||
{
|
||||
if (handler != null)
|
||||
{
|
||||
@@ -102,7 +100,7 @@ namespace MediaBrowser.Common.Events
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error in event handler", ex);
|
||||
logger.ErrorException("Error in event handler", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace MediaBrowser.Common.Kernel
|
||||
/// </summary>
|
||||
internal void OnConfigurationUpdated()
|
||||
{
|
||||
EventHelper.QueueEventIfNotNull(ConfigurationUpdated, this, EventArgs.Empty);
|
||||
EventHelper.QueueEventIfNotNull(ConfigurationUpdated, this, EventArgs.Empty, Logger);
|
||||
|
||||
// Notify connected clients
|
||||
TcpManager.SendWebSocketMessage("ConfigurationUpdated", Configuration);
|
||||
@@ -73,7 +73,7 @@ namespace MediaBrowser.Common.Kernel
|
||||
/// </summary>
|
||||
private void OnLoggerLoaded()
|
||||
{
|
||||
EventHelper.QueueEventIfNotNull(LoggerLoaded, this, EventArgs.Empty);
|
||||
EventHelper.QueueEventIfNotNull(LoggerLoaded, this, EventArgs.Empty, Logger);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace MediaBrowser.Common.Kernel
|
||||
/// </summary>
|
||||
private void OnReloadBeginning()
|
||||
{
|
||||
EventHelper.QueueEventIfNotNull(ReloadBeginning, this, EventArgs.Empty);
|
||||
EventHelper.QueueEventIfNotNull(ReloadBeginning, this, EventArgs.Empty, Logger);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace MediaBrowser.Common.Kernel
|
||||
/// </summary>
|
||||
private void OnReloadCompleted()
|
||||
{
|
||||
EventHelper.QueueEventIfNotNull(ReloadCompleted, this, EventArgs.Empty);
|
||||
EventHelper.QueueEventIfNotNull(ReloadCompleted, this, EventArgs.Empty, Logger);
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace MediaBrowser.Common.Kernel
|
||||
/// <param name="newVersion">The new version.</param>
|
||||
public void OnApplicationUpdated(Version newVersion)
|
||||
{
|
||||
EventHelper.QueueEventIfNotNull(ApplicationUpdated, this, new GenericEventArgs<Version> { Argument = newVersion });
|
||||
EventHelper.QueueEventIfNotNull(ApplicationUpdated, this, new GenericEventArgs<Version> { Argument = newVersion }, Logger);
|
||||
|
||||
NotifyPendingRestart();
|
||||
}
|
||||
@@ -351,9 +351,21 @@ namespace MediaBrowser.Common.Kernel
|
||||
/// Initializes a new instance of the <see cref="BaseKernel{TApplicationPathsType}" /> class.
|
||||
/// </summary>
|
||||
/// <param name="isoManager">The iso manager.</param>
|
||||
protected BaseKernel(IIsoManager isoManager)
|
||||
/// <param name="logger">The logger.</param>
|
||||
protected BaseKernel(IIsoManager isoManager, ILogger logger)
|
||||
{
|
||||
if (isoManager == null)
|
||||
{
|
||||
throw new ArgumentNullException("isoManager");
|
||||
}
|
||||
|
||||
if (logger == null)
|
||||
{
|
||||
throw new ArgumentNullException("logger");
|
||||
}
|
||||
|
||||
IsoManager = isoManager;
|
||||
Logger = logger;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -362,8 +374,6 @@ namespace MediaBrowser.Common.Kernel
|
||||
/// <returns>Task.</returns>
|
||||
public async Task Init()
|
||||
{
|
||||
Logger = Logging.LogManager.GetLogger(GetType().Name);
|
||||
|
||||
ApplicationPaths = new TApplicationPathsType();
|
||||
|
||||
IsFirstRun = !File.Exists(ApplicationPaths.SystemConfigurationFilePath);
|
||||
@@ -496,7 +506,7 @@ namespace MediaBrowser.Common.Kernel
|
||||
/// <param name="container">The container.</param>
|
||||
protected virtual void ComposeExportedValues(CompositionContainer container)
|
||||
{
|
||||
container.ComposeExportedValue("logger", Logging.LogManager.GetLogger("App"));
|
||||
container.ComposeExportedValue("logger", Logger);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -588,7 +598,7 @@ namespace MediaBrowser.Common.Kernel
|
||||
|
||||
try
|
||||
{
|
||||
plugin.Initialize(this, Logging.LogManager.GetLogger(plugin.GetType().Name));
|
||||
plugin.Initialize(this, Logger);
|
||||
|
||||
Logger.Info("{0} {1} initialized.", plugin.Name, plugin.Version);
|
||||
}
|
||||
@@ -609,7 +619,7 @@ namespace MediaBrowser.Common.Kernel
|
||||
|
||||
TcpManager.SendWebSocketMessage("HasPendingRestartChanged", GetSystemInfo());
|
||||
|
||||
EventHelper.QueueEventIfNotNull(HasPendingRestartChanged, this, EventArgs.Empty);
|
||||
EventHelper.QueueEventIfNotNull(HasPendingRestartChanged, this, EventArgs.Empty, Logger);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -749,7 +759,7 @@ namespace MediaBrowser.Common.Kernel
|
||||
{
|
||||
Logger.Info("Restarting the application");
|
||||
|
||||
EventHelper.QueueEventIfNotNull(ApplicationRestartRequested, this, EventArgs.Empty);
|
||||
EventHelper.QueueEventIfNotNull(ApplicationRestartRequested, this, EventArgs.Empty, Logger);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -150,7 +150,7 @@ namespace MediaBrowser.Common.Kernel
|
||||
/// <param name="context">The context.</param>
|
||||
private void OnAlchemyWebSocketClientConnected(UserContext context)
|
||||
{
|
||||
var connection = new WebSocketConnection(new AlchemyWebSocket(context), context.ClientAddress, ProcessWebSocketMessageReceived);
|
||||
var connection = new WebSocketConnection(new AlchemyWebSocket(context, Logger), context.ClientAddress, ProcessWebSocketMessageReceived, Logger);
|
||||
|
||||
_webSocketConnections.Add(connection);
|
||||
}
|
||||
@@ -173,7 +173,7 @@ namespace MediaBrowser.Common.Kernel
|
||||
|
||||
try
|
||||
{
|
||||
HttpServer = new HttpServer(Kernel.HttpServerUrlPrefix, "Media Browser", Kernel);
|
||||
HttpServer = new HttpServer(Kernel.HttpServerUrlPrefix, "Media Browser", Kernel, Logger);
|
||||
}
|
||||
catch (HttpListenerException ex)
|
||||
{
|
||||
@@ -202,7 +202,7 @@ namespace MediaBrowser.Common.Kernel
|
||||
/// <param name="e">The <see cref="WebSocketConnectEventArgs" /> instance containing the event data.</param>
|
||||
void HttpServer_WebSocketConnected(object sender, WebSocketConnectEventArgs e)
|
||||
{
|
||||
var connection = new WebSocketConnection(e.WebSocket, e.Endpoint, ProcessWebSocketMessageReceived);
|
||||
var connection = new WebSocketConnection(e.WebSocket, e.Endpoint, ProcessWebSocketMessageReceived, Logger);
|
||||
|
||||
_webSocketConnections.Add(connection);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace MediaBrowser.Common.Net
|
||||
/// <summary>
|
||||
/// The logger
|
||||
/// </summary>
|
||||
private static ILogger Logger = LogManager.GetLogger("AlchemyWebSocket");
|
||||
private readonly ILogger _logger;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the web socket.
|
||||
@@ -29,20 +29,22 @@ namespace MediaBrowser.Common.Net
|
||||
/// Initializes a new instance of the <see cref="AlchemyWebSocket" /> class.
|
||||
/// </summary>
|
||||
/// <param name="context">The context.</param>
|
||||
/// <param name="logger">The logger.</param>
|
||||
/// <exception cref="System.ArgumentNullException">context</exception>
|
||||
public AlchemyWebSocket(UserContext context)
|
||||
public AlchemyWebSocket(UserContext context, ILogger logger)
|
||||
{
|
||||
if (context == null)
|
||||
{
|
||||
throw new ArgumentNullException("context");
|
||||
}
|
||||
|
||||
_logger = logger;
|
||||
UserContext = context;
|
||||
|
||||
context.SetOnDisconnect(OnDisconnected);
|
||||
context.SetOnReceive(OnReceive);
|
||||
|
||||
Logger.Info("Client connected from {0}", context.ClientAddress);
|
||||
_logger.Info("Client connected from {0}", context.ClientAddress);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -87,7 +89,7 @@ namespace MediaBrowser.Common.Net
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error processing web socket message", ex);
|
||||
_logger.ErrorException("Error processing web socket message", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace MediaBrowser.Common.Net
|
||||
/// <summary>
|
||||
/// The logger
|
||||
/// </summary>
|
||||
private static ILogger Logger = Logging.LogManager.GetLogger("HttpServer");
|
||||
private readonly ILogger _logger;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the URL prefix.
|
||||
@@ -69,17 +69,27 @@ namespace MediaBrowser.Common.Net
|
||||
/// <param name="urlPrefix">The URL.</param>
|
||||
/// <param name="serverName">Name of the product.</param>
|
||||
/// <param name="kernel">The kernel.</param>
|
||||
/// <param name="logger">The logger.</param>
|
||||
/// <param name="defaultRedirectpath">The default redirectpath.</param>
|
||||
/// <exception cref="System.ArgumentNullException">urlPrefix</exception>
|
||||
public HttpServer(string urlPrefix, string serverName, IKernel kernel, string defaultRedirectpath = null)
|
||||
public HttpServer(string urlPrefix, string serverName, IKernel kernel, ILogger logger, string defaultRedirectpath = null)
|
||||
: base()
|
||||
{
|
||||
if (string.IsNullOrEmpty(urlPrefix))
|
||||
{
|
||||
throw new ArgumentNullException("urlPrefix");
|
||||
}
|
||||
if (kernel == null)
|
||||
{
|
||||
throw new ArgumentNullException("kernel");
|
||||
}
|
||||
if (logger == null)
|
||||
{
|
||||
throw new ArgumentNullException("logger");
|
||||
}
|
||||
|
||||
DefaultRedirectPath = defaultRedirectpath;
|
||||
_logger = logger;
|
||||
|
||||
EndpointHostConfig.Instance.ServiceStackHandlerFactoryPath = null;
|
||||
EndpointHostConfig.Instance.MetadataRedirectPath = "metadata";
|
||||
@@ -274,12 +284,12 @@ namespace MediaBrowser.Common.Net
|
||||
|
||||
if (WebSocketConnected != null)
|
||||
{
|
||||
WebSocketConnected(this, new WebSocketConnectEventArgs { WebSocket = new NativeWebSocket(webSocketContext.WebSocket), Endpoint = ctx.Request.RemoteEndPoint });
|
||||
WebSocketConnected(this, new WebSocketConnectEventArgs { WebSocket = new NativeWebSocket(webSocketContext.WebSocket, _logger), Endpoint = ctx.Request.RemoteEndPoint });
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("AcceptWebSocketAsync error", ex);
|
||||
_logger.ErrorException("AcceptWebSocketAsync error", ex);
|
||||
|
||||
ctx.Response.StatusCode = 500;
|
||||
ctx.Response.Close();
|
||||
@@ -301,7 +311,7 @@ namespace MediaBrowser.Common.Net
|
||||
|
||||
if (Kernel.Configuration.EnableHttpLevelLogging)
|
||||
{
|
||||
Logger.LogMultiline(type + " request received from " + ctx.Request.RemoteEndPoint, LogSeverity.Debug, log);
|
||||
_logger.LogMultiline(type + " request received from " + ctx.Request.RemoteEndPoint, LogSeverity.Debug, log);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,7 +323,7 @@ namespace MediaBrowser.Common.Net
|
||||
/// <param name="statusCode">The status code.</param>
|
||||
private void HandleException(HttpListenerResponse response, Exception ex, int statusCode)
|
||||
{
|
||||
Logger.ErrorException("Error processing request", ex);
|
||||
_logger.ErrorException("Error processing request", ex);
|
||||
|
||||
response.StatusCode = statusCode;
|
||||
|
||||
@@ -352,7 +362,7 @@ namespace MediaBrowser.Common.Net
|
||||
}
|
||||
catch (Exception errorEx)
|
||||
{
|
||||
Logger.ErrorException("Error processing failed request", errorEx);
|
||||
_logger.ErrorException("Error processing failed request", errorEx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -408,7 +418,7 @@ namespace MediaBrowser.Common.Net
|
||||
|
||||
if (Kernel.Configuration.EnableHttpLevelLogging)
|
||||
{
|
||||
Logger.LogMultiline(msg, LogSeverity.Debug, log);
|
||||
_logger.LogMultiline(msg, LogSeverity.Debug, log);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using MediaBrowser.Common.Logging;
|
||||
using MediaBrowser.Common.Serialization;
|
||||
using MediaBrowser.Common.Serialization;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using System;
|
||||
using System.IO;
|
||||
@@ -17,7 +16,7 @@ namespace MediaBrowser.Common.Net
|
||||
/// <summary>
|
||||
/// The logger
|
||||
/// </summary>
|
||||
private static ILogger Logger = LogManager.GetLogger("NativeWebSocket");
|
||||
private readonly ILogger _logger;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the web socket.
|
||||
@@ -29,14 +28,21 @@ namespace MediaBrowser.Common.Net
|
||||
/// Initializes a new instance of the <see cref="NativeWebSocket" /> class.
|
||||
/// </summary>
|
||||
/// <param name="socket">The socket.</param>
|
||||
/// <param name="logger">The logger.</param>
|
||||
/// <exception cref="System.ArgumentNullException">socket</exception>
|
||||
public NativeWebSocket(WebSocket socket)
|
||||
public NativeWebSocket(WebSocket socket, ILogger logger)
|
||||
{
|
||||
if (socket == null)
|
||||
{
|
||||
throw new ArgumentNullException("socket");
|
||||
}
|
||||
|
||||
if (logger == null)
|
||||
{
|
||||
throw new ArgumentNullException("logger");
|
||||
}
|
||||
|
||||
_logger = logger;
|
||||
WebSocket = socket;
|
||||
|
||||
Receive();
|
||||
@@ -66,7 +72,7 @@ namespace MediaBrowser.Common.Net
|
||||
}
|
||||
catch (WebSocketException ex)
|
||||
{
|
||||
Logger.ErrorException("Error reveiving web socket message", ex);
|
||||
_logger.ErrorException("Error reveiving web socket message", ex);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -83,7 +89,7 @@ namespace MediaBrowser.Common.Net
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error processing web socket message", ex);
|
||||
_logger.ErrorException("Error processing web socket message", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace MediaBrowser.Common.Net
|
||||
/// <summary>
|
||||
/// The logger
|
||||
/// </summary>
|
||||
private static readonly ILogger Logger = LogManager.GetLogger("WebSocketConnection");
|
||||
private readonly ILogger _logger;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WebSocketConnection" /> class.
|
||||
@@ -46,7 +46,7 @@ namespace MediaBrowser.Common.Net
|
||||
/// <param name="remoteEndPoint">The remote end point.</param>
|
||||
/// <param name="receiveAction">The receive action.</param>
|
||||
/// <exception cref="System.ArgumentNullException">socket</exception>
|
||||
public WebSocketConnection(IWebSocket socket, EndPoint remoteEndPoint, Action<WebSocketMessageInfo> receiveAction)
|
||||
public WebSocketConnection(IWebSocket socket, EndPoint remoteEndPoint, Action<WebSocketMessageInfo> receiveAction, ILogger logger)
|
||||
{
|
||||
if (socket == null)
|
||||
{
|
||||
@@ -60,10 +60,15 @@ namespace MediaBrowser.Common.Net
|
||||
{
|
||||
throw new ArgumentNullException("receiveAction");
|
||||
}
|
||||
if (logger == null)
|
||||
{
|
||||
throw new ArgumentNullException("logger");
|
||||
}
|
||||
|
||||
_socket = socket;
|
||||
_socket.OnReceiveDelegate = info => OnReceive(info, receiveAction);
|
||||
RemoteEndPoint = remoteEndPoint;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -81,7 +86,7 @@ namespace MediaBrowser.Common.Net
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error processing web socket message", ex);
|
||||
_logger.ErrorException("Error processing web socket message", ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,13 +153,13 @@ namespace MediaBrowser.Common.Net
|
||||
}
|
||||
catch (OperationCanceledException)
|
||||
{
|
||||
Logger.Info("WebSocket message to {0} was cancelled", RemoteEndPoint);
|
||||
_logger.Info("WebSocket message to {0} was cancelled", RemoteEndPoint);
|
||||
|
||||
throw;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.ErrorException("Error sending WebSocket message {0}", ex, RemoteEndPoint);
|
||||
_logger.ErrorException("Error sending WebSocket message {0}", ex, RemoteEndPoint);
|
||||
|
||||
throw;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using MediaBrowser.Common.Kernel;
|
||||
using MediaBrowser.Common.Logging;
|
||||
using MediaBrowser.Common.Updates;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using Microsoft.Win32;
|
||||
@@ -84,9 +83,10 @@ namespace MediaBrowser.Common.UI
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BaseApplication" /> class.
|
||||
/// </summary>
|
||||
protected BaseApplication()
|
||||
/// <param name="logger">The logger.</param>
|
||||
protected BaseApplication(ILogger logger)
|
||||
{
|
||||
Logger = LogManager.GetLogger("App");
|
||||
Logger = logger;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -397,20 +397,6 @@ namespace MediaBrowser.Common.UI
|
||||
RenderOptions.SetBitmapScalingMode(bitmap, BitmapScalingMode.Fant);
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs the application.
|
||||
/// </summary>
|
||||
/// <typeparam name="TApplicationType">The type of the T application type.</typeparam>
|
||||
/// <param name="uniqueKey">The unique key.</param>
|
||||
public static void RunApplication<TApplicationType>(string uniqueKey)
|
||||
where TApplicationType : BaseApplication, IApplication, new()
|
||||
{
|
||||
var application = new TApplicationType();
|
||||
application.InitializeComponent();
|
||||
|
||||
application.Run();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user