ProcessControl.cs
1 using Logging; 2 3 namespace CodexClient 4 { 5 public interface IProcessControlFactory 6 { 7 IProcessControl CreateProcessControl(ICodexInstance instance); 8 } 9 10 public interface IProcessControl 11 { 12 void Stop(bool waitTillStopped); 13 IDownloadedLog DownloadLog(LogFile file); 14 void DeleteDataDirFolder(); 15 bool HasCrashed(); 16 } 17 18 public class DoNothingProcessControlFactory : IProcessControlFactory 19 { 20 public IProcessControl CreateProcessControl(ICodexInstance instance) 21 { 22 return new DoNothingProcessControl(); 23 } 24 } 25 26 public class DoNothingProcessControl : IProcessControl 27 { 28 public void DeleteDataDirFolder() 29 { 30 } 31 32 public IDownloadedLog DownloadLog(LogFile file) 33 { 34 throw new NotImplementedException("Not supported by DoNothingProcessControl"); 35 } 36 37 public bool HasCrashed() 38 { 39 return false; 40 } 41 42 public void Stop(bool waitTillStopped) 43 { 44 } 45 } 46 }