<PackageReference Include="System.Security.Permissions" Version="9.0.0" />

CodeGroup

public abstract class CodeGroup
Represents the abstract base class from which all implementations of code groups must derive.
public virtual string AttributeString { get; }

Gets a string representation of the attributes of the policy statement for the code group.

public IList Children { get; set; }

Gets or sets an ordered list of the child code groups of a code group.

public string Description { get; set; }

Gets or sets the description of the code group.

Gets or sets the code group's membership condition.

public abstract string MergeLogic { get; }

When overridden in a derived class, gets the merge logic for the code group.

public string Name { get; set; }

Gets or sets the name of the code group.

public virtual string PermissionSetName { get; }

Gets the name of the named permission set for the code group.

public PolicyStatement PolicyStatement { get; set; }

Gets or sets the policy statement associated with the code group.

protected CodeGroup(IMembershipCondition membershipCondition, PolicyStatement policy)

Initializes a new instance of CodeGroup.

public void AddChild(CodeGroup group)

Adds a child code group to the current code group.

public abstract CodeGroup Copy()

When overridden in a derived class, makes a deep copy of the current code group.

protected virtual void CreateXml(SecurityElement element, PolicyLevel level)

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.

public bool 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.

public void FromXml(SecurityElement e)

Reconstructs a security object with a given state from an XML encoding.

public void FromXml(SecurityElement e, PolicyLevel level)

Reconstructs a security object with a given state and policy level from an XML encoding.

protected virtual void ParseXml(SecurityElement e, PolicyLevel level)

When overridden in a derived class, reconstructs properties and internal state specific to a derived code group from the specified SecurityElement.

public void RemoveChild(CodeGroup group)

Removes the specified child code group.

public abstract PolicyStatement Resolve(Evidence evidence)

When overridden in a derived class, resolves policy for the code group and its descendants for a set of evidence.

public abstract CodeGroup ResolveMatchingCodeGroups(Evidence evidence)

When overridden in a derived class, resolves matching code groups.

Creates an XML encoding of the security object and its current state.

Creates an XML encoding of the security object, its current state, and the policy level within which the code exists.