SafeFileWritingCleanupEventArgs.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Wayne.Lib.IO
  5. {
  6. /// <summary>
  7. /// Event argument that is used to notify and ask what action to take if a partially written file is found.
  8. /// </summary>
  9. public class SafeFileWritingCleanupEventArgs : UserTokenEventArgs
  10. {
  11. #region Fields
  12. private SafeFileWritingCleanupAction action = SafeFileWritingCleanupAction.Delete;
  13. private string fileName;
  14. #endregion
  15. /// <summary>
  16. /// Creates a new instance of the SafeFileWritingCleanupEventArgs class.
  17. /// </summary>
  18. /// <param name="fileName"></param>
  19. /// <param name="userToken"></param>
  20. internal SafeFileWritingCleanupEventArgs(string fileName, object userToken)
  21. : base(userToken)
  22. {
  23. this.fileName = fileName;
  24. }
  25. #region Properties
  26. /// <summary>
  27. /// Sets or gets the action to take for the found temporary file.
  28. /// </summary>
  29. public SafeFileWritingCleanupAction Action
  30. {
  31. get { return action; }
  32. set { action = value; }
  33. }
  34. /// <summary>
  35. /// Name of the found temporary file.
  36. /// </summary>
  37. public string FileName
  38. {
  39. get { return fileName; }
  40. }
  41. #endregion
  42. }
  43. }