Cleaned up code smells.
Made fields readonly when possible. Changed message for exception regarding argument to be correct.
This commit is contained in:
parent
acd735d9df
commit
3a49502970
@ -6,7 +6,7 @@ namespace GameServiceWarden.Host.Modules
|
||||
{
|
||||
class ModuleLoadContext : AssemblyLoadContext
|
||||
{
|
||||
private AssemblyDependencyResolver dependencyResolver;
|
||||
private readonly AssemblyDependencyResolver dependencyResolver;
|
||||
|
||||
public ModuleLoadContext(string path) {
|
||||
dependencyResolver = new AssemblyDependencyResolver(path);
|
||||
|
@ -6,7 +6,7 @@ namespace GameServiceWarden.Host.Modules
|
||||
{
|
||||
public class ServiceGateway
|
||||
{
|
||||
private string dataDirectory;
|
||||
private readonly string dataDirectory;
|
||||
private const string SERVICE_NAME = "Service Name";
|
||||
private const string ASSEMBLY_NAME = "Assembly Name";
|
||||
private const string MODULE_NAME = "Module Name";
|
||||
|
@ -22,7 +22,7 @@ namespace GameServiceWarden.Host.Modules
|
||||
/// </summary>
|
||||
private volatile string serviceName; //thread-safe(?)
|
||||
public Stream ServiceConsoleStream { get; private set; } // Thread safe.
|
||||
private object controlLock = new object();
|
||||
private readonly object controlLock = new object();
|
||||
private volatile ServiceState state;
|
||||
private readonly IGameService service;
|
||||
private readonly string assemblyName;
|
||||
@ -32,7 +32,7 @@ namespace GameServiceWarden.Host.Modules
|
||||
|
||||
public ServiceInfo(IGameService service, string moduleName, string assemblyName)
|
||||
{
|
||||
this.service = service ?? throw new ArgumentNullException("serviceable");
|
||||
this.service = service ?? throw new ArgumentNullException("service");
|
||||
this.moduleName = moduleName ?? throw new ArgumentNullException("moduleName");
|
||||
this.assemblyName = assemblyName ?? throw new ArgumentNullException("assemblyName");
|
||||
this.service.StateChangeEvent += OnServiceStateChange;
|
||||
|
Reference in New Issue
Block a user