Mon Jul 1 18:01:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
[mono.git] / mcs / class / corlib / System.Reflection / AssemblyName.cs
index da8a10d1917635e1581ab9f3bbd5a0b208587538..a457ebb1614b8364e61ddade61ef48cd61c24645 100755 (executable)
@@ -1,3 +1,4 @@
+
 //
 // System.Reflection/AssemblyName.cs
 //
 
 using System;
 using System.Reflection;
+using System.Globalization;
+using System.Configuration.Assemblies;
+using System.Runtime.Serialization;
 
 namespace System.Reflection {
 
-       public class AssemblyName /* : ICloneable, ISerializable, IDeserializationCallback */ {
-
-               private string name;
+       [Serializable]
+       public sealed class AssemblyName  : ISerializable // ICloneable, , IDeserializationCallback
+       {
+               string name = "";
+               string codebase;
+               int major, minor, build, revision;
+               CultureInfo cultureinfo;
+               AssemblyNameFlags flags;
+               AssemblyHashAlgorithm hashalg;
+               StrongNameKeyPair keypair;
+               AssemblyVersionCompatibility versioncompat;
                
-               public virtual string Name {
-                       get {return name;}
-                       set {name = value;}
+               public AssemblyName ()
+               {
+               }
+
+               internal AssemblyName (SerializationInfo si, StreamingContext sc)
+               {
+                       name = si.GetString ("_Name");
+                       codebase = si.GetString ("_CodeBase");
+                       Version = (Version)si.GetValue ("_Version", typeof (Version));
+               }
+
+               public string Name {
+                       get {
+                               return name;
+                       }
+                       set {
+                               name = value;
+                       }
+               }
+
+               public string CodeBase {
+                       get {
+                               return codebase;
+                       }
+
+                       set {
+                               codebase = value;
+                       }
+               }
+
+               [MonoTODO]
+               public string EscapedCodeBase {
+                       get {
+                               return codebase;
+                       }
+               }
+
+               public CultureInfo CultureInfo {
+                       get {
+                               return cultureinfo;
+                       }
+
+                       set {
+                               cultureinfo = value;
+                       }
+               }
+
+               public AssemblyNameFlags Flags {
+                       get {
+                               return flags;
+                       }
+
+                       set {
+                               flags = value;
+                       }
+               }
+
+               [MonoTODO]
+               public string FullName {
+                       get {
+                               return name;
+                       }
+               }
+
+               public AssemblyHashAlgorithm HashAlgorithm {
+                       get {
+                               return hashalg;
+                       }
+
+                       set {
+                               hashalg = value;
+                       }
+               }
+
+               public StrongNameKeyPair KeyPair {
+                       get {
+                               return keypair;
+                       }
+
+                       set {
+                               keypair = value;
+                       }
                }
 
-               public AssemblyName () {
-                       name = null;
+               public Version Version {
+                       get {
+                               return new Version (major, minor, build, revision);
+                       }
+
+                       set {
+                               major = value.Major;
+                               minor = value.Minor;
+                               build = value.Build;
+                               revision = value.Revision;
+                       }
                }
 
+               public AssemblyVersionCompatibility VersionCompatibility {
+                       get {
+                               return versioncompat;
+                       }
+
+                       set {
+                               versioncompat = value;
+                       }
+               }
+               
                public override int GetHashCode ()
                {
                        return name.GetHashCode ();
@@ -43,6 +153,16 @@ namespace System.Reflection {
                        return false;
                }
 
-       }
+               [MonoTODO]
+               public byte[] GetPublicKeyToken() {
+                       return new byte[0];
+               }
 
+               public void GetObjectData (SerializationInfo info, StreamingContext context)
+               {
+                       info.AddValue ("_Name", name);
+                       info.AddValue ("_CodeBase", codebase);
+                       info.AddValue ("_Version", Version);
+               }
+       }
 }