FirstMatchCodeGroup allows security policy to be defined that works similar to a switch {case 1: ...; case 2: ...; ... default: ...; } conditional structure.
Object
FirstMatchCodeGroup
[Visual Basic] NotInheritable Public Class FirstMatchCodeGroup Implements ICodeGroup, ISecurityEncodable, _ ISecurityPolicyEncodable [C#] public sealed class FirstMatchCodeGroup : ICodeGroup, ISecurityEncodable, ISecurityPolicyEncodable [C++] public __gc __sealed class FirstMatchCodeGroup : public ICodeGroup, ISecurityEncodable, ISecurityPolicyEncodable [JScript] public class FirstMatchCodeGroup implements ICodeGroup, ISecurityEncodable, ISecurityPolicyEncodable
Code groups are the building blocks of code access security policy. Each policy level consists of a root code group that may have child code groups and so on forming a tree. Each code group has a membership condition that determines if a given assembly belongs to it or not based on the evidence for that assembly. Only code groups whose membership conditions match a given assembly and their children apply policy.
Like any code group, FirstMatchCodeGroup only applies when its membership condition matches evidence for an assembly. If so it tests the membership condition of each child in order stopping when the first match occurs: the policy statement of the first matching child code group then becomes the result of the FirstMatchCodeGroup. However, if no child code group matches the evidence then the policy statement on the parent FirstMatchCodeGroup code group is used (similar to the "default" statement above) as the result.
FirstMatchCodeGroup code groups cannot be created by the CASPOL utility in Beta1- they are intended for programmatic use by application domain hosts to set domain policy.
Namespace: System.Security.Policy
Assembly: mscorlib.dll
FirstMatchCodeGroup Members | System.Security.Policy Namespace