ReflectionPermission.ReflectionPermission(PermissionState) Constructor

Initializes a new instance of the ReflectionPermission class with either fully restricted or unrestricted permission as specified.

Namespace: System.Security.Permissions
Assembly: mscorlib (in mscorlib.dll)

public ReflectionPermission (
	PermissionState state
public ReflectionPermission (
	PermissionState state
public function ReflectionPermission (
	state : PermissionState
Not applicable.



One of the PermissionState values.

Exception typeCondition


The state parameter is not a valid value of PermissionState.

Creates either fully restricted (None) or Unrestricted access to metadata.

The following code example shows the use of the System.Security.Permissions.ReflectionPermission(PermissionState) constructor. This example is part of a larger example provided for the ReflectionPermission class.

ReflectionPermission reflectionPerm2 = new ReflectionPermission(PermissionState.None);

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0