-
//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// AssemblyHash.cs
+//
+// Authors:
+// Tomas Restrepo (tomasr@mvps.org)
+// Sebastien Pouliot <sebastien@ximian.com>
+//
+// Copyright (C) 2004, 2006 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-//
-// AssemblyHash.cs
-//
-// Implementation of the
-// System.Configuration.Assemblies.AssemblyHash
-// class for the Mono Class Library
-//
-// Author:
-// Tomas Restrepo (tomasr@mvps.org)
-//
+using System.Runtime.InteropServices;
namespace System.Configuration.Assemblies {
-
- [Serializable]
- public struct AssemblyHash : System.ICloneable
- {
- private AssemblyHashAlgorithm _algorithm;
- private byte[] _value;
-
- public static readonly AssemblyHash Empty =
- new AssemblyHash(AssemblyHashAlgorithm.None,null);
+ [Serializable]
+#if NET_2_0
+ [ComVisible (true)]
+ [Obsolete]
+#endif
+ public struct AssemblyHash : ICloneable {
- //
- // properties
- //
- public AssemblyHashAlgorithm Algorithm {
- get { return _algorithm; }
- set { _algorithm = value; }
- }
+ private AssemblyHashAlgorithm _algorithm;
+ private byte[] _value;
+#if NET_2_0
+ [Obsolete]
+#endif
+ public static readonly AssemblyHash Empty = new AssemblyHash (AssemblyHashAlgorithm.None, null);
- //
- // construction
- //
- public AssemblyHash ( AssemblyHashAlgorithm algorithm, byte[] value )
- {
- _algorithm = algorithm;
- _value = null;
- if ( value != null )
- {
- int size = value.Length;
- _value = new byte[size];
- System.Array.Copy ( value, _value, size );
- }
- }
+#if NET_2_0
+ [Obsolete]
+#endif
+ public AssemblyHashAlgorithm Algorithm {
+ get { return _algorithm; }
+ set { _algorithm = value; }
+ }
- public AssemblyHash ( byte[] value )
- : this(AssemblyHashAlgorithm.SHA1, value)
- {
- }
- public object Clone()
- {
- return new AssemblyHash(_algorithm,_value);
- }
+#if NET_2_0
+ [Obsolete]
+#endif
+ public AssemblyHash (AssemblyHashAlgorithm algorithm, byte[] value)
+ {
+ _algorithm = algorithm;
+ if (value != null)
+ _value = (byte[]) value.Clone ();
+ else
+ _value = null;
+ }
- public byte[] GetValue()
- {
- return _value;
- }
- public void SetValue ( byte[] value )
- {
- _value = value;
- }
+#if NET_2_0
+ [Obsolete]
+#endif
+ public AssemblyHash (byte[] value)
+ : this (AssemblyHashAlgorithm.SHA1, value)
+ {
+ }
- } // class AssemblyHash
+#if NET_2_0
+ [Obsolete]
+#endif
+ public object Clone ()
+ {
+ return new AssemblyHash (_algorithm, _value);
+ }
-} // namespace System.Configuration.Assemblies
+#if NET_2_0
+ [Obsolete]
+#endif
+ public byte[] GetValue ()
+ {
+ return _value;
+ }
+#if NET_2_0
+ [Obsolete]
+#endif
+ public void SetValue (byte[] value)
+ {
+ _value = value;
+ }
+ }
+}