[Serializable] |
AttributeString | Read-only Gets a string representation of the attributes of the policy statement for the code group. |
Children | Read-write Gets or sets an ordered list of the child code groups of a code group. |
Description | Read-write Gets or sets the description of the code group. |
MembershipCondition | Read-write Gets or sets the code group's membership condition. |
MergeLogic | Read-only When overridden in a derived class, gets the merge logic for the code group. |
Name | Read-write Gets or sets the name of the code group. |
PermissionSetName | Read-only Gets the name of the named permission set for the code group. |
PolicyStatement | Read-write Gets or sets the policy statement associated with the code group. |
AddChild | Adds a child code group to the current code group. |
Copy | When overridden in a derived class, 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 | Overloaded:Equals(CodeGroup cg, bool compareChildren) Determines whether the specified code group is equivalent to the current code group, checking the child code groups as well, if specified. |
FromXml | Overloaded:FromXml(SecurityElement e) Reconstructs a security object with a given state from an XML encoding. |
FromXml | Overloaded:FromXml(SecurityElement e, PolicyLevel level) Reconstructs 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 | Removes the specified child code group. |
Resolve | When overridden in a derived class, resolves policy for the code group and its descendants for a set of evidence. |
ResolveMatchingCodeGroups | When overridden in a derived class, 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 | 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, its current state, and the policy level within which the code exists. |
CreateXml | When overridden in a derived class, serializes properties and internal state specific to a derived code group and adds the serialization to the specified SecurityElement. |
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 | When overridden in a derived class, reconstructs properties and internal state specific to a derived code group from the specified SecurityElement. |
Hierarchy:
public CodeGroup( |
membershipCondition
policy
Exception Type | Condition |
---|---|
ArgumentNullException | The membershipCondition parameter is null. |
ArgumentException | The type of the membershipCondition parameter is not valid. -or- The type of the policy parameter is not valid. |
public virtual 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 abstract string MergeLogic {get;}
|
public string Name {get; set;}
|
public virtual 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 abstract CodeGroup Copy(); |
protected virtual void CreateXml( |
element
level
The XML created using this method is deserialized by the CodeGroup.ParseXml method.
o
This method tests the top-level code group only, not its child code groups.
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.
~CodeGroup(); |
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 virtual void ParseXml( |
e
level
This method deserializes XML created using CodeGroup.CreateXml.
public void RemoveChild( |
group
Exception Type | Condition |
---|---|
ArgumentException | The group parameter is not an immediate child code group of the current code group. |
public abstract PolicyStatement Resolve( |
evidence
For a UnionCodeGroup, all child code groups whose membership condition match the specified evidence are also resolved, and all resulting policy statements are combined with the policy statement of the parent union code group. Each child code group type determines how all child groups under it are applied, depending on how the CodeGroup.Resolve methods of these child groups work.
The .NET Framework security system uses CodeGroup.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.
evidence
public virtual string ToString(); |
public SecurityElement ToXml(); |
public SecurityElement ToXml( |
level