implemented large parts of WCF standard endpoints and configuration support.
[mono.git] / mcs / class / corlib / System.Security.Permissions / UrlIdentityPermission.cs
index 837572b703d7faeb8ef9bf025bb587077850cdb7..277b60a6ace9c33b1c59e47ff8121d0491ab6caa 100644 (file)
@@ -5,7 +5,7 @@
 //     Sebastien Pouliot  <sebastien@ximian.com>
 //
 // Copyright (C) 2003 Motus Technologies. http://www.motus.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
 //
 
 using System.Globalization;
+using System.Runtime.InteropServices;
 
 namespace System.Security.Permissions {
 
        [Serializable]
+       [ComVisible (true)]
        public sealed class UrlIdentityPermission : CodeAccessPermission, IBuiltInPermission {
 
                private const int version = 1;
@@ -42,9 +44,7 @@ namespace System.Security.Permissions {
                {
                        // false == do not allow Unrestricted for Identity Permissions
                        CheckPermissionState (state, false);
-#if NET_2_0
                        url = String.Empty;
-#endif
                }
 
                public UrlIdentityPermission (string site)
@@ -55,28 +55,13 @@ namespace System.Security.Permissions {
                }
 
                public string Url { 
-                       get { 
-#if !NET_2_0
-                               if (url == null)
-                                       throw new NullReferenceException ("Url");
-#endif
-                               return url; 
-                       }
-                       set {
-                               if (value == null)
-                                       throw new ArgumentNullException ("Url");
-                               url = value;
-                       }
+                       get { return url; }
+                       set { url = ((value == null) ? String.Empty : value); }
                }
-
                public override IPermission Copy () 
                {
                        if (url == null) {
-#if NET_2_0
                                return new UrlIdentityPermission (PermissionState.None);
-#else
-                               throw new NullReferenceException ("Url");
-#endif
                        }
                        else
                                return new UrlIdentityPermission (url);
@@ -157,12 +142,8 @@ namespace System.Security.Permissions {
                                else
                                        return uip.Copy ();
                        }
-#if NET_2_0
                        throw new ArgumentException (Locale.GetText (
                                "Cannot union two different urls."), "target");
-#else
-                       return null;
-#endif
                }
 
                // IBuiltInPermission