[Serializable] |
FileCodeGroup has the same child matching semantics as UnionCodeGroup. However, FileCodeGroup returns a permission set containing a dynamically-calculated FileIOPermission that grants file access to the directory from which the code is run; UnionCodeGroup only returns a static permission set. The type of file access granted is passed as a parameter to the constructor.
This code group only matches assemblies run over a file protocol, that is, assemblies that have URLs that point to a file or UNC path.
ctor #1 | Initializes a new instance of the FileCodeGroup class. |
AttributeString | Read-only Overridden: Gets a string representation of the attributes of the policy statement for the code group. |
Children (inherited from System.Security.Policy.CodeGroup) |
Read-write See base class member description: System.Security.Policy.CodeGroup.Children Gets or sets an ordered list of the child code groups of a code group. |
Description (inherited from System.Security.Policy.CodeGroup) |
Read-write See base class member description: System.Security.Policy.CodeGroup.Description Gets or sets the description of the code group. |
MembershipCondition (inherited from System.Security.Policy.CodeGroup) |
Read-write See base class member description: System.Security.Policy.CodeGroup.MembershipCondition Gets or sets the code group's membership condition. |
MergeLogic | Read-only Overridden: Gets the merge logic. |
Name (inherited from System.Security.Policy.CodeGroup) |
Read-write See base class member description: System.Security.Policy.CodeGroup.Name Gets or sets the name of the code group. |
PermissionSetName | Read-only Overridden: Gets the name of the named permission set for the code group. |
PolicyStatement (inherited from System.Security.Policy.CodeGroup) |
Read-write See base class member description: System.Security.Policy.CodeGroup.PolicyStatement Gets or sets the policy statement associated with the code group. |
AddChild (inherited from System.Security.Policy.CodeGroup) |
See base class member description: System.Security.Policy.CodeGroup.AddChild Adds a child code group to the current code group. |
Copy | Overridden: Makes a deep copy of the current code group. |
Equals | Overloaded:Equals(object o) Overridden: Determines whether the specified code group is equivalent to the current code group. |
Equals (inherited from System.Security.Policy.CodeGroup) |
Overloaded:Equals(CodeGroup cg, bool compareChildren) See base class member description: System.Security.Policy.CodeGroup.EqualsDetermines whether the specified code group is equivalent to the current code group, checking the child code groups as well, if specified. |
FromXml (inherited from System.Security.Policy.CodeGroup) |
Overloaded:FromXml(SecurityElement e) See base class member description: System.Security.Policy.CodeGroup.FromXmlReconstructs a security object with a given state from an XML encoding. |
FromXml (inherited from System.Security.Policy.CodeGroup) |
Overloaded:FromXml(SecurityElement e, PolicyLevel level) See base class member description: System.Security.Policy.CodeGroup.FromXmlReconstructs a security object with a given state and policy level from an XML encoding. |
GetHashCode | Overridden: Gets the hash code of the current code group. |
GetType (inherited from System.Object) |
See base class member description: System.Object.GetType Derived from System.Object, the primary base class for all objects. |
RemoveChild (inherited from System.Security.Policy.CodeGroup) |
See base class member description: System.Security.Policy.CodeGroup.RemoveChild Removes the specified child code group. |
Resolve | Overridden: Resolves policy for the code group and its descendants for a set of evidence. |
ResolveMatchingCodeGroups | Overridden: Resolves matching code groups. |
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 (inherited from System.Security.Policy.CodeGroup) |
Overloaded:ToXml() See base class member description: System.Security.Policy.CodeGroup.ToXmlCreates an XML encoding of the security object and its current state. |
ToXml (inherited from System.Security.Policy.CodeGroup) |
Overloaded:ToXml(PolicyLevel level) See base class member description: System.Security.Policy.CodeGroup.ToXmlCreates an XML encoding of the security object, its current state, and the policy level within which the code exists. |
CreateXml | Overridden: Creates an XML encoding of the security object, its current state, and the policy level within which the code exists. |
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. |
ParseXml | Overridden: Reconstructs a security object with a given state and policy level from an XML encoding. |
Hierarchy:
public FileCodeGroup( |
membershipCondition
access
Exception Type | Condition |
---|---|
ArgumentNullException | The membershipCondition parameter is null. |
ArgumentException | The type of the membershipCondition parameter is not valid. -or- The type of the access parameter is not valid. |
FileCodeGroup returns a permission set containing a dynamically-calculated FileIOPermission that grants file access to the directory from which the code is run. The type of access granted is determined by the access parameter.
public override string AttributeString {get;}
|
public IList Children {get; set;}
|
Exception Type | Condition |
---|---|
ArgumentException | An attempt is made to set this property to null. |
public string Description {get; set;}
|
public IMembershipCondition MembershipCondition {get; set;}
|
Exception Type | Condition |
---|---|
ArgumentException | An attempt is made to set this parameter to null. |
public override string MergeLogic {get;}
|
public string Name {get; set;}
|
public override string PermissionSetName {get;}
|
public PolicyStatement PolicyStatement {get; set;}
|
This property can also be set by passing a policy statement to the constructor.
codeGroup.PolicyStatement = new PolicyStatement(new NamedPermissionSet("MyPermissionSet"));
public void AddChild( |
group
Exception Type | Condition |
---|---|
ArgumentNullException | The group parameter is null. |
ArgumentException | The group parameter is not a valid code group. |
public override CodeGroup Copy(); |
protected override void CreateXml( |
element
level
o
cg
compareChildren
If the compareChildren parameter is true, this method will only return true if the current code group and all its child code groups are equivalent to the specified code group and all its child code groups.
~FileCodeGroup(); |
public void FromXml( |
e
Exception Type | Condition |
---|---|
ArgumentNullException | The e parameter is null. |
public void FromXml( |
e
level
Exception Type | Condition |
---|---|
ArgumentNullException | The e parameter is null. |
public override int GetHashCode(); |
public Type GetType(); |
protected object MemberwiseClone(); |
protected override void ParseXml( |
e
level
public void RemoveChild( |
group
Exception Type | Condition |
---|---|
ArgumentException | The group parameter is not an immediate child code group of the current code group. |
public override PolicyStatement Resolve( |
evidence
Exception Type | Condition |
---|---|
ArgumentNullException | The evidence parameter is null. |
PolicyException | The current policy is null. -or- More than one code group (including the parent code group and all child code groups) is marked PolicyStatementAttribute.Exclusive. |
The .NET Framework security system uses FileCodeGroup.Resolve on the policy levels to determine which permissions to grant to loaded code from the resulting policy statements and the code request on the assembly.
FileCodeGroup uses union semantics and forms a permission set based on the Url specified by evidence.
evidence
Exception Type | Condition |
---|---|
ArgumentNullException | The evidence parameter is null. |
FileCodeGroup uses union semantics and forms a permission set based on the Url specified by evidence.
public virtual string ToString(); |
public SecurityElement ToXml(); |
public SecurityElement ToXml( |
level