PageRenderTime 44ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/Utilities/Compression/KeyRequiredEventArgs.cs

#
C# | 90 lines | 47 code | 11 blank | 32 comment | 0 complexity | 69a2a817d765d4f2c62336ab75a8cc0c MD5 | raw file
Possible License(s): Apache-2.0
  1. // Based on Mike Krueger's SharpZipLib, Copyright (C) 2001 (GNU license).
  2. // Authors of the original java version: Jochen Hoenicke, John Leuner
  3. // See http://www.ISeeSharpCode.com for more information.
  4. using System;
  5. namespace Delta.Utilities.Compression
  6. {
  7. /// <summary>
  8. /// Arguments used with KeysRequiredEvent
  9. /// </summary>
  10. public class KeysRequiredEventArgs : EventArgs
  11. {
  12. #region FileName (Public)
  13. /// <summary>
  14. /// Get the name of the file for which keys are required.
  15. /// </summary>
  16. public string FileName
  17. {
  18. get
  19. {
  20. return fileName;
  21. } // get
  22. }
  23. #endregion
  24. #region Private
  25. #region fileName (Private)
  26. /// <summary>
  27. /// File Name
  28. /// </summary>
  29. private readonly string fileName;
  30. #endregion
  31. #region key (Private)
  32. /// <summary>
  33. /// Key
  34. /// </summary>
  35. private byte[] key;
  36. #endregion
  37. #endregion
  38. #region Constructors
  39. /// <summary>
  40. /// Initialise a new instance of <see cref="KeysRequiredEventArgs"></see>
  41. /// </summary>
  42. /// <param name="name">The name of the file for which keys are required.</param>
  43. public KeysRequiredEventArgs(string name)
  44. {
  45. fileName = name;
  46. }
  47. // KeysRequiredEventArgs(name)
  48. /// <summary>
  49. /// Initialise a new instance of <see cref="KeysRequiredEventArgs"></see>
  50. /// </summary>
  51. /// <param name="name">The name of the file for which keys are required.</param>
  52. /// <param name="keyValue">The current key value.</param>
  53. public KeysRequiredEventArgs(string name, byte[] keyValue)
  54. {
  55. fileName = name;
  56. key = keyValue;
  57. }
  58. #endregion
  59. #region GetKey (Public)
  60. /// <summary>
  61. /// Get key
  62. /// </summary>
  63. public byte[] GetKey()
  64. {
  65. return key;
  66. }
  67. #endregion
  68. #region SetKey (Public)
  69. /// <summary>
  70. /// Set key
  71. /// </summary>
  72. /// <param name="newKey">New key</param>
  73. public void SetKey(byte[] newKey)
  74. {
  75. key = newKey;
  76. }
  77. #endregion
  78. }
  79. }