System.Security.Policy.Zone Class

Assembly: Mscorlib.dll
Namespace: System.Security.Policy
Summary
Provides the security zone of a code assembly as evidence for policy evaluation. This class cannot be inherited.
C# Syntax:
[Serializable]
public sealed class Zone : IIdentityPermissionFactory
Remarks
The presence of Zone evidence produces a ZoneIdentityPermission in the grant set. If there is a CodeAccessPermission.Demand for ZoneIdentityPermission, the ZoneIdentityPermission that corresponds to the Zone evidence will be compared with the demanded permission.

Zones are defined by the SecurityZone enumeration.

See also:
System.Security.Policy Namespace

System.Security.Policy.Zone Member List:

Public Constructors
ctor #1 Initializes a new instance of the Zone class with the zone from which a code assembly originates.
Public Properties
SecurityZone Read-only

Gets the zone from which the code assembly originates.
Public Methods
Copy Creates an equivalent copy of the evidence object.
CreateFromUrl Creates a new zone with the specified URL.
CreateIdentityPermission Creates an identity permission that corresponds to the current instance of the Zone evidence class.
Equals Overridden:
Compares the current Zone evidence object to the specified object for equivalence.
GetHashCode Overridden:
Gets the hash code of the current zone.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
ToString Overridden:
Returns a string representation of the current Zone.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.Security.Policy.Zone Member Details

ctor #1
Summary
Initializes a new instance of the Zone class with the zone from which a code assembly originates.
C# Syntax:
public Zone(SecurityZone(
   SecurityZone zone
);
Parameters:

zone

The zone of origin for the associated code assembly.

Exceptions
Exception Type Condition
ArgumentException The zone parameter is not a valid SecurityZone.

Return to top


Property: SecurityZone (read-only)
Summary
Gets the zone from which the code assembly originates.
C# Syntax:
public SecurityZone SecurityZone {get;}

Return to top


Method: Copy()
Summary
Creates an equivalent copy of the evidence object.
C# Syntax:
public object Copy();
Return Value:
A new, identical copy of the evidence object.

Return to top


Method: CreateFromUrl(
   string url
)
Summary
Creates a new zone with the specified URL.
C# Syntax:
public static Zone CreateFromUrl(
   string url
);
Parameters:

url

The URL from which to create the zone.

Return Value:
A new zone with the specified URL.
Exceptions
Exception Type Condition
ArgumentNullException The url parameter is null.
Remarks
The zone determination for the specified URL is based on the zone mapping settings in Microsoft Internet Explorer and can therefore differ from computer to computer. The zone mapping settings are located on the Security tab of the Internet Options dialog launched from the Tools menu.

Return to top


Method: CreateIdentityPermission(
   Evidence evidence
)
Summary
Creates an identity permission that corresponds to the current instance of the Zone evidence class.
C# Syntax:
public IPermission CreateIdentityPermission(
   Evidence evidence
);
Parameters:

evidence

The evidence set from which to construct the identity permission.

Return Value:
A ZoneIdentityPermission for the specified Zone evidence.
Implements:
IIdentityPermissionFactory.CreateIdentityPermission

Return to top


Overridden Method: Equals(
   object o
)
Summary
Compares the current Zone evidence object to the specified object for equivalence.
C# Syntax:
public override bool Equals(
   object o
);
Parameters:

o

The Zone evidence object to test for equivalence with the current object.

Return Value:
true if the two Zone objects are equal; otherwise, false.
Exceptions
Exception Type Condition
ArgumentException The o parameter is not a Zone object.
Remarks
Zone objects are equal if they designate the same SecurityZone.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~Zone();

For more information on members inherited from System.Object click on the link above.

Return to top


Overridden Method: GetHashCode()
Summary
Gets the hash code of the current zone.
C# Syntax:
public override int GetHashCode();
Return Value:
The hash code of the current zone.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Overridden Method: ToString()
Summary
Returns a string representation of the current Zone.
C# Syntax:
public override string ToString();
Return Value:
A representation of the current Zone.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.