System.Security.Policy.PolicyStatement Class

Assembly: Mscorlib.dll
Namespace: System.Security.Policy
Summary
Represents the statement of a CodeGroup describing the permissions and other information that apply to code with a particular set of evidence. This class cannot be inherited.
C# Syntax:
[Serializable]
public sealed class PolicyStatement : ISecurityEncodable, ISecurityPolicyEncodable
Remarks
PolicyStatement consists of a set of granted permissions, and possible special attributes for the code group.

Policy statements are typically used as the result of a PolicyLevel.Resolve operation on a PolicyLevel.

See also:
System.Security.Policy Namespace

System.Security.Policy.PolicyStatement Member List:

Public Constructors
ctor #1 Overloaded:
.ctor(PermissionSet permSet)

Initializes a new instance of the PolicyStatement class with the specified PermissionSet.
ctor #2 Overloaded:
.ctor(PermissionSet permSet, PolicyStatementAttribute attributes)

Initializes a new instance of the PolicyStatement class with the specified PermissionSet and attributes.
Public Properties
Attributes Read-write

Gets or sets the attributes of the policy statement.
AttributeString Read-only

Gets a human-readable representation of the attributes of the policy statement.
PermissionSet Read-write

Gets or sets the PermissionSet of the policy statement.
Public Methods
Copy Creates an equivalent copy of the current policy statement.
Equals
(inherited from System.Object)
See base class member description: System.Object.Equals

Derived from System.Object, the primary base class for all objects.
FromXml Overloaded:
FromXml(SecurityElement et)

Reconstructs a security object with a given state from an XML encoding.
FromXml Overloaded:
FromXml(SecurityElement et, PolicyLevel level)

Reconstructs a security object with a given state from an XML encoding.
GetHashCode
(inherited from System.Object)
See base class member description: System.Object.GetHashCode

Derived from System.Object, the primary base class for all objects.
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
(inherited from System.Object)
See base class member description: System.Object.ToString

Derived from System.Object, the primary base class for all objects.
ToXml Overloaded:
ToXml()

Creates an XML encoding of the security object and its current state.
ToXml Overloaded:
ToXml(PolicyLevel level)

Creates an XML encoding of the security object and its current state.
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.PolicyStatement Member Details

Overloaded ctor #1
Summary
Initializes a new instance of the PolicyStatement class with the specified PermissionSet.
C# Syntax:
public PolicyStatement(
   PermissionSet permSet
);
Parameters:

permSet

The PermissionSet with which to initialize the new instance.

Return to top


Overloaded ctor #2
Summary
Initializes a new instance of the PolicyStatement class with the specified PermissionSet and attributes.
C# Syntax:
public PolicyStatement(PermissionSet permSet, PolicyStatement(
   PermissionSet permSet,
   PolicyStatementAttribute attributes
);
Parameters:

permSet

The PermissionSet with which to initialize the new instance.

attributes

A bitwise combination of the PolicyStatementAttribute values.

Return to top


Property: Attributes (read-write)
Summary
Gets or sets the attributes of the policy statement.
C# Syntax:
public PolicyStatementAttribute Attributes {get; set;}

Return to top


Property: AttributeString (read-only)
Summary
Gets a human-readable representation of the attributes of the policy statement.
C# Syntax:
public string AttributeString {get;}
Remarks
Use this property to get a text string of the attributes currently set for the PolicyStatement.

Return to top


Property: PermissionSet (read-write)
Summary
Gets or sets the PermissionSet of the policy statement.
C# Syntax:
public PermissionSet PermissionSet {get; set;}

Return to top


Method: Copy()
Summary
Creates an equivalent copy of the current policy statement.
C# Syntax:
public PolicyStatement Copy();
Return Value:
A new copy of the PolicyStatement with PolicyStatement.PermissionSet and PolicyStatement.Attributes identical to those of the current PolicyStatement.

Return to top


Method: Equals(
   object obj
)
Inherited
See base class member description: System.Object.Equals
C# Syntax:
public virtual bool Equals(
   object obj
);

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

Return to top


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

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

Return to top


Overloaded Method: FromXml(
   SecurityElement et
)
Summary
Reconstructs a security object with a given state from an XML encoding.
C# Syntax:
public void FromXml(
   SecurityElement et
);
Parameters:

et

The XML encoding to use to reconstruct the security object.

Implements:
ISecurityEncodable.FromXml

Return to top


Overloaded Method: FromXml(
   SecurityElement et,
   PolicyLevel level
)
Summary
Reconstructs a security object with a given state from an XML encoding.
C# Syntax:
public void FromXml(
   SecurityElement et,
   PolicyLevel level
);
Parameters:

et

The XML encoding to use to reconstruct the security object.

level

The PolicyLevel context for lookup of NamedPermissionSet values.

Exceptions
Exception Type Condition
ArgumentNullException The et parameter is null.
ArgumentException The et parameter is not a valid PolicyStatement encoding.
Implements:
ISecurityPolicyEncodable.FromXml

Return to top


Method: GetHashCode()
Inherited
See base class member description: System.Object.GetHashCode
C# Syntax:
public virtual int GetHashCode();

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

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


Method: ToString()
Inherited
See base class member description: System.Object.ToString
C# Syntax:
public virtual string ToString();

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

Return to top


Overloaded Method: ToXml()
Summary
Creates an XML encoding of the security object and its current state.
C# Syntax:
public SecurityElement ToXml();
Return Value:
An XML encoding of the security object, including any state information.
Implements:
ISecurityEncodable.ToXml

Return to top


Overloaded Method: ToXml(
   PolicyLevel level
)
Summary
Creates an XML encoding of the security object and its current state.
C# Syntax:
public SecurityElement ToXml(
   PolicyLevel level
);
Parameters:

level

The PolicyLevel context for lookup of NamedPermissionSet values.

Return Value:
An XML encoding of the security object, including any state information.
Implements:
ISecurityPolicyEncodable.ToXml

Return to top


Top of page

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