2025-01-16 11:31:50 +01:00
|
|
|
|
using Logging;
|
|
|
|
|
|
|
|
|
|
|
|
namespace CodexClient
|
|
|
|
|
|
{
|
2025-01-16 15:13:16 +01:00
|
|
|
|
public interface IProcessControlFactory
|
2025-01-16 13:24:57 +01:00
|
|
|
|
{
|
|
|
|
|
|
IProcessControl CreateProcessControl(ICodexInstance instance);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-01-16 11:31:50 +01:00
|
|
|
|
public interface IProcessControl
|
|
|
|
|
|
{
|
2025-01-16 13:24:57 +01:00
|
|
|
|
void Stop(bool waitTillStopped);
|
|
|
|
|
|
IDownloadedLog DownloadLog(LogFile file);
|
|
|
|
|
|
void DeleteDataDirFolder();
|
|
|
|
|
|
bool HasCrashed();
|
2025-01-16 11:31:50 +01:00
|
|
|
|
}
|
2025-01-16 15:13:16 +01:00
|
|
|
|
|
|
|
|
|
|
public class DoNothingProcessControlFactory : IProcessControlFactory
|
|
|
|
|
|
{
|
|
|
|
|
|
public IProcessControl CreateProcessControl(ICodexInstance instance)
|
|
|
|
|
|
{
|
|
|
|
|
|
return new DoNothingProcessControl();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class DoNothingProcessControl : IProcessControl
|
|
|
|
|
|
{
|
|
|
|
|
|
public void DeleteDataDirFolder()
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public IDownloadedLog DownloadLog(LogFile file)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new NotImplementedException("Not supported by DoNothingProcessControl");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool HasCrashed()
|
|
|
|
|
|
{
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Stop(bool waitTillStopped)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-01-16 11:31:50 +01:00
|
|
|
|
}
|