SafeFileWritingCleanupEventArgs.cs 1.3 KB

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