// 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;
{
// false == do not allow Unrestricted for Identity Permissions
CheckPermissionState (state, false);
-#if NET_2_0
url = String.Empty;
-#endif
}
public UrlIdentityPermission (string site)
}
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);
else
return uip.Copy ();
}
-#if NET_2_0
throw new ArgumentException (Locale.GetText (
"Cannot union two different urls."), "target");
-#else
- return null;
-#endif
}
// IBuiltInPermission