System.Security.Policy.ApplicationDirectoryMembershipCondition Class

Assembly: Mscorlib.dll
Namespace: System.Security.Policy
Summary
Determines whether an assembly belongs to a code group by testing its application directory. This class cannot be inherited.
C# Syntax:
[Serializable]
public sealed class ApplicationDirectoryMembershipCondition : IMembershipCondition, ISecurityEncodable, ISecurityPolicyEncodable
Remarks
ApplicationDirectoryMembershipCondition determines whether an ApplicationDirectory ApplicationDirectory.Directory property contains the assembly URL evidence path. For example, if the ApplicationDirectory is C:\app1, then assemblies with URL evidence such as C:\app1, C:\app1\main.aspx, C:\app1\folder1, or C:\app1\folder1\main1.aspx match this membership condition. Code not in the C:\app1 directory, or one of its subdirectories, fails this membership condition test.

Code without either ApplicationDirectory or Url evidence always fails this membership condition test.

See also:
System.Security.Policy Namespace

System.Security.Policy.ApplicationDirectoryMembershipCondition Member List:

Public Constructors
ctor #1 Default constructor. This constructor is called by derived class constructors to initialize state in this type.
Initializes a new instance of the ApplicationDirectoryMembershipCondition class.
Public Methods
Check Determines whether the membership condition is satisfied by the specified evidence.
Copy Creates an equivalent copy of the membership condition.
Equals Overridden:
Determines whether the specified membership condition is an ApplicationDirectoryMembershipCondition.
FromXml Overloaded:
FromXml(SecurityElement e)

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

Reconstructs a security object with a specified state from an XML encoding.
GetHashCode Overridden:
Gets the hash code for the current membership condition.
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:
Creates and returns a string representation of the membership condition.
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 with the specified PolicyLevel.
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.ApplicationDirectoryMembershipCondition Member Details

ctor #1
Summary
Initializes a new instance of the ApplicationDirectoryMembershipCondition class.

Default constructor. This constructor is called by derived class constructors to initialize state in this type.
C# Syntax:
public ApplicationDirectoryMembershipCondition();
Remarks
The membership condition tests whether the assembly URL evidence is a path within the directory specified by ApplicationDirectory.

Return to top


Method: Check(
   Evidence evidence
)
Summary
Determines whether the membership condition is satisfied by the specified evidence.
C# Syntax:
public bool Check(
   Evidence evidence
);
Parameters:

evidence

The evidence set against which to make the test.

Return Value:
true if the specified evidence satisfies the membership condition; otherwise, false.
Implements:
IMembershipCondition.Check
Remarks
The evidence parameter must contain both ApplicationDirectory evidence that specifies the application directory of the running application and Url evidence that specifies the code base of the assembly. The code base specified by the Url evidence must represent a path in the directory tree of the application directory specified by the ApplicationDirectory evidence for this method to return true.

Return to top


Method: Copy()
Summary
Creates an equivalent copy of the membership condition.
C# Syntax:
public IMembershipCondition Copy();
Return Value:
A new, identical copy of the current membership condition.
Implements:
IMembershipCondition.Copy

Return to top


Overridden Method: Equals(
   object o
)
Summary
Determines whether the specified membership condition is an ApplicationDirectoryMembershipCondition.
C# Syntax:
public override bool Equals(
   object o
);
Parameters:

o

The object to compare to ApplicationDirectoryMembershipCondition.

Return Value:
true if the specified membership condition is an ApplicationDirectoryMembershipCondition; otherwise, false.
Implements:
IMembershipCondition.Equals

Return to top


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

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

Return to top


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

e

The XML encoding to use to reconstruct the security object.

Exceptions
Exception Type Condition
ArgumentNullException The e parameter is null.
ArgumentException The e parameter is not a valid application directory membership condition element.
Implements:
ISecurityEncodable.FromXml

Return to top


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

e

The XML encoding to use to reconstruct the security object.

level

The policy level context, used to resolve named permission set references.

Exceptions
Exception Type Condition
ArgumentNullException The e parameter is null.
ArgumentException The e parameter is not a valid application directory membership condition element.
Implements:
ISecurityPolicyEncodable.FromXml

Return to top


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

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
Creates and returns a string representation of the membership condition.
C# Syntax:
public override string ToString();
Return Value:
A string representation of the state of the membership condition.
Implements:
IMembershipCondition.ToString

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 with the specified PolicyLevel.
C# Syntax:
public SecurityElement ToXml(
   PolicyLevel level
);
Parameters:

level

The policy level context for resolving named permission set references.

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.