SharingViolationException.cs 766 B

123456789101112131415161718192021222324
  1. /* Copyright (C) 2014-2018 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
  2. *
  3. * You can redistribute this program and/or modify it under the terms of
  4. * the GNU Lesser Public License as published by the Free Software Foundation,
  5. * either version 3 of the License, or (at your option) any later version.
  6. */
  7. using System.IO;
  8. namespace DiskAccessLibrary
  9. {
  10. public class SharingViolationException : IOException
  11. {
  12. public SharingViolationException() : this("Sharing Violation")
  13. {
  14. }
  15. public SharingViolationException(string message) : base(message)
  16. {
  17. #if Win32
  18. HResult = IOExceptionHelper.GetHResultFromWin32Error(Win32Error.ERROR_SHARING_VIOLATION);
  19. #endif
  20. }
  21. }
  22. }