String.Split(char[],int,StringSplitOptions) should remove empty entries while
[mono.git] / mcs / class / corlib / System / ApplicationIdentity.cs
index d95274f14521f9cd415fc046c129ba9867d70c0b..b0fda9a20db292b0aa95742db35180105d7e187c 100644 (file)
@@ -4,7 +4,7 @@
 // Author:
 //     Sebastien Pouliot  <sebastien@ximian.com>
 //
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 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
 
 #if NET_2_0
 
+using System.Runtime.InteropServices;
+using System.Runtime.Serialization;
+
 namespace System {
 
-       public sealed class ApplicationIdentity {
+       [Serializable]
+       [ComVisible (false)]
+       public sealed class ApplicationIdentity: ISerializable {
 
                private string _fullName;
                private string _codeBase;
 
                public ApplicationIdentity (string applicationIdentityFullName)
                {
-                       _fullName = applicationIdentityFullName;
+                       if (applicationIdentityFullName == null)
+                               throw new ArgumentNullException ("applicationIdentityFullName");
+
+                       if (applicationIdentityFullName.IndexOf (", Culture=") == -1)
+                               _fullName = applicationIdentityFullName + ", Culture=neutral";
+                       else
+                               _fullName = applicationIdentityFullName;
                }
 
-               [MonoTODO ("URL but where does it comes from?")]
+               //
+               // FIXME: "URL for deployment manifest", this message should be clearer!
+               // 
                public string CodeBase {
                        get { return _codeBase; }
                }
@@ -49,10 +62,16 @@ namespace System {
                        get { return _fullName; }
                }
 
-               [MonoTODO]
                public override string ToString ()
                {
-                       return base.ToString ();
+                       return _fullName;
+               }
+
+               [MonoTODO ("Missing serialization")]
+               void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
+               {
+                       if (info == null)
+                               throw new ArgumentNullException ("info");
                }
        }
 }