PageRenderTime 48ms CodeModel.GetById 43ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/Utilities/Compression/KeyRequiredEventArgs.cs

#
C# | 90 lines | 47 code | 11 blank | 32 comment | 0 complexity | 69a2a817d765d4f2c62336ab75a8cc0c MD5 | raw file
 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
 5using System;
 6
 7namespace Delta.Utilities.Compression
 8{
 9	/// <summary>
10	/// Arguments used with KeysRequiredEvent
11	/// </summary>
12	public class KeysRequiredEventArgs : EventArgs
13	{
14		#region FileName (Public)
15		/// <summary>
16		/// Get the name of the file for which keys are required.
17		/// </summary>
18		public string FileName
19		{
20			get
21			{
22				return fileName;
23			} // get
24		}
25		#endregion
26
27		#region Private
28
29		#region fileName (Private)
30		/// <summary>
31		/// File Name
32		/// </summary>
33		private readonly string fileName;
34		#endregion
35
36		#region key (Private)
37		/// <summary>
38		/// Key
39		/// </summary>
40		private byte[] key;
41		#endregion
42
43		#endregion
44
45		#region Constructors
46		/// <summary>
47		/// Initialise a new instance of <see cref="KeysRequiredEventArgs"></see>
48		/// </summary>
49		/// <param name="name">The name of the file for which keys are required.</param>
50		public KeysRequiredEventArgs(string name)
51		{
52			fileName = name;
53		}
54
55		// KeysRequiredEventArgs(name)
56
57		/// <summary>
58		/// Initialise a new instance of <see cref="KeysRequiredEventArgs"></see>
59		/// </summary>
60		/// <param name="name">The name of the file for which keys are required.</param>
61		/// <param name="keyValue">The current key value.</param>
62		public KeysRequiredEventArgs(string name, byte[] keyValue)
63		{
64			fileName = name;
65			key = keyValue;
66		}
67		#endregion
68
69		#region GetKey (Public)
70		/// <summary>
71		/// Get key
72		/// </summary>
73		public byte[] GetKey()
74		{
75			return key;
76		}
77		#endregion
78
79		#region SetKey (Public)
80		/// <summary>
81		/// Set key
82		/// </summary>
83		/// <param name="newKey">New key</param>
84		public void SetKey(byte[] newKey)
85		{
86			key = newKey;
87		}
88		#endregion
89	}
90}