SvdService.cs 904 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using System.Net;
  3. using SvdCli.DriverAdapt;
  4. using SvdCli.Storage;
  5. namespace SvdCli.App
  6. {
  7. internal class SvdService
  8. {
  9. private readonly IStorage _storage;
  10. private readonly EndPoint _serverEndPoint;
  11. private readonly VirtualDrive _virtualDrive;
  12. public SvdService(IStorage storage, EndPoint serverEndPoint)
  13. {
  14. _storage = storage ?? throw new ArgumentNullException(nameof(storage));
  15. _serverEndPoint = serverEndPoint;
  16. _virtualDrive = new VirtualDrive(_storage);
  17. }
  18. public void Start()
  19. {
  20. if (null != _serverEndPoint) throw new NotImplementedException();
  21. _virtualDrive.Attach();
  22. }
  23. public void Stop()
  24. {
  25. if (null != _serverEndPoint) throw new NotImplementedException();
  26. _virtualDrive.Detach();
  27. }
  28. }
  29. }