/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
- // Based on Mike Krueger's SharpZipLib, Copyright (C) 2001 (GNU license).
- // Authors of the original java version: Jochen Hoenicke, John Leuner
- // See http://www.ISeeSharpCode.com for more information.
-
- using System;
-
- namespace Delta.Utilities.Compression
- {
- /// <summary>
- /// Arguments used with KeysRequiredEvent
- /// </summary>
- public class KeysRequiredEventArgs : EventArgs
- {
- #region FileName (Public)
- /// <summary>
- /// Get the name of the file for which keys are required.
- /// </summary>
- public string FileName
- {
- get
- {
- return fileName;
- } // get
- }
- #endregion
-
- #region Private
-
- #region fileName (Private)
- /// <summary>
- /// File Name
- /// </summary>
- private readonly string fileName;
- #endregion
-
- #region key (Private)
- /// <summary>
- /// Key
- /// </summary>
- private byte[] key;
- #endregion
-
- #endregion
-
- #region Constructors
- /// <summary>
- /// Initialise a new instance of <see cref="KeysRequiredEventArgs"></see>
- /// </summary>
- /// <param name="name">The name of the file for which keys are required.</param>
- public KeysRequiredEventArgs(string name)
- {
- fileName = name;
- }
-
- // KeysRequiredEventArgs(name)
-
- /// <summary>
- /// Initialise a new instance of <see cref="KeysRequiredEventArgs"></see>
- /// </summary>
- /// <param name="name">The name of the file for which keys are required.</param>
- /// <param name="keyValue">The current key value.</param>
- public KeysRequiredEventArgs(string name, byte[] keyValue)
- {
- fileName = name;
- key = keyValue;
- }
- #endregion
-
- #region GetKey (Public)
- /// <summary>
- /// Get key
- /// </summary>
- public byte[] GetKey()
- {
- return key;
- }
- #endregion
-
- #region SetKey (Public)
- /// <summary>
- /// Set key
- /// </summary>
- /// <param name="newKey">New key</param>
- public void SetKey(byte[] newKey)
- {
- key = newKey;
- }
- #endregion
- }
- }