New tests.
[mono.git] / mcs / class / corlib / System.Security.Policy / ZoneMembershipCondition.cs
index b51796a958a7ae1eee87f2a1e72d22edd6e2e899..d3a831b2814bf141f50c7d34621693915cd64de7 100644 (file)
@@ -6,7 +6,7 @@
 //     Sebastien Pouliot  <sebastien@ximian.com>
 //
 // (C) 2003, Ximian Inc.
-// 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
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+#if !MOONLIGHT
+
 using System.Collections;
 using System.Globalization;
+using System.Runtime.InteropServices;
 
 namespace System.Security.Policy {
 
        [Serializable]
-        public sealed class ZoneMembershipCondition : IMembershipCondition, IConstantMembershipCondition {
+       [ComVisible (true)]
+       public sealed class ZoneMembershipCondition : IMembershipCondition, IConstantMembershipCondition {
 
                private readonly int version = 1;
 
@@ -88,24 +92,24 @@ namespace System.Security.Policy {
                         return new ZoneMembershipCondition (zone);
                 }
 
-                public override bool Equals (Object o)
-                {
-                        if (o is ZoneMembershipCondition == false)
-                                return false;
-                        else
-                                return ((ZoneMembershipCondition) o).SecurityZone == zone;
-                }
+               public override bool Equals (object o)
+               {
+                       ZoneMembershipCondition zmc = (o as ZoneMembershipCondition);
+                       if (zmc == null)
+                               return false;
+                       return (zmc.SecurityZone == zone);
+               }
 
-                public void FromXml (SecurityElement element)
+                public void FromXml (SecurityElement e)
                 {
-                        FromXml (element, null);
+                        FromXml (e, null);
                 }
 
-               public void FromXml (SecurityElement element, PolicyLevel level)
+               public void FromXml (SecurityElement e, PolicyLevel level)
                {
-                       MembershipConditionHelper.CheckSecurityElement (element, "element", version, version);
+                       MembershipConditionHelper.CheckSecurityElement (e, "e", version, version);
 
-                       string z = element.Attribute ("Zone");
+                       string z = e.Attribute ("Zone");
                        if (z != null) {
                                zone = (SecurityZone) Enum.Parse (typeof (SecurityZone), z);
                        }
@@ -135,3 +139,6 @@ namespace System.Security.Policy {
                 }
         }
 }
+
+#endif
+