Allow injection of loggers
parent
5237e88612
commit
20de9d6cae
|
@ -15,7 +15,7 @@ namespace LANCommander.SDK
|
|||
{
|
||||
public class Client
|
||||
{
|
||||
private static readonly ILogger Logger;
|
||||
private readonly ILogger Logger;
|
||||
|
||||
private readonly RestClient ApiClient;
|
||||
private AuthToken Token;
|
||||
|
@ -26,6 +26,14 @@ namespace LANCommander.SDK
|
|||
ApiClient = new RestClient(baseUrl);
|
||||
}
|
||||
|
||||
public Client(string baseUrl, ILogger logger)
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(baseUrl))
|
||||
ApiClient = new RestClient(baseUrl);
|
||||
|
||||
Logger = logger;
|
||||
}
|
||||
|
||||
private T PostRequest<T>(string route, object body)
|
||||
{
|
||||
var request = new RestRequest(route)
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace LANCommander.SDK
|
|||
{
|
||||
public class GameManager
|
||||
{
|
||||
private static readonly ILogger Logger;
|
||||
private readonly ILogger Logger;
|
||||
private Client Client { get; set; }
|
||||
private string DefaultInstallDirectory { get; set; }
|
||||
|
||||
|
@ -30,6 +30,12 @@ namespace LANCommander.SDK
|
|||
Client = client;
|
||||
}
|
||||
|
||||
public GameManager(Client client, ILogger logger)
|
||||
{
|
||||
Client = client;
|
||||
Logger = logger;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Downloads, extracts, and runs post-install scripts for the specified game
|
||||
/// </summary>
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace LANCommander.SDK
|
|||
{
|
||||
public class RedistributableManager
|
||||
{
|
||||
private static readonly ILogger Logger;
|
||||
private readonly ILogger Logger;
|
||||
private Client Client { get; set; }
|
||||
|
||||
public delegate void OnArchiveEntryExtractionProgressHandler(object sender, ArchiveEntryExtractionProgressArgs e);
|
||||
|
@ -29,6 +29,12 @@ namespace LANCommander.SDK
|
|||
Client = client;
|
||||
}
|
||||
|
||||
public RedistributableManager(Client client, ILogger logger)
|
||||
{
|
||||
Client = client;
|
||||
Logger = logger;
|
||||
}
|
||||
|
||||
public void Install(Game game)
|
||||
{
|
||||
foreach (var redistributable in game.Redistributables)
|
||||
|
|
Loading…
Reference in New Issue