Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
548 lines (490 sloc) 36.6 KB
<Type Name="ReflectionPermission" FullName="System.Security.Permissions.ReflectionPermission">
<TypeSignature Language="C#" Value="public sealed class ReflectionPermission : System.Security.CodeAccessPermission, System.Security.Permissions.IUnrestrictedPermission" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi serializable sealed beforefieldinit ReflectionPermission extends System.Security.CodeAccessPermission implements class System.Security.Permissions.IUnrestrictedPermission" />
<TypeSignature Language="DocId" Value="T:System.Security.Permissions.ReflectionPermission" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class ReflectionPermission&#xA;Inherits CodeAccessPermission&#xA;Implements IUnrestrictedPermission" />
<TypeSignature Language="C++ CLI" Value="public ref class ReflectionPermission sealed : System::Security::CodeAccessPermission, System::Security::Permissions::IUnrestrictedPermission" />
<TypeSignature Language="F#" Value="type ReflectionPermission = class&#xA; inherit CodeAccessPermission&#xA; interface IUnrestrictedPermission" />
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Permissions</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Security.CodeAccessPermission</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.Security.Permissions.IUnrestrictedPermission</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0">
<AttributeName>System.Serializable</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Controls access to non-public types and members through the <see cref="N:System.Reflection" /> APIs. Controls some features of the <see cref="N:System.Reflection.Emit" /> APIs.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Without <xref:System.Security.Permissions.ReflectionPermission>, code can use reflection to access only the public members of objects. Code with <xref:System.Security.Permissions.ReflectionPermission> and the appropriate <xref:System.Security.Permissions.ReflectionPermissionFlag> flags can access the `protected` and `private` members of objects.
> [!CAUTION]
> Because <xref:System.Security.Permissions.ReflectionPermission> can provide access to non-public types and members, we recommend that you do not grant <xref:System.Security.Permissions.ReflectionPermission> to Internet code, except with the <xref:System.Security.Permissions.ReflectionPermissionFlag.RestrictedMemberAccess?displayProperty=nameWithType> flag. <xref:System.Security.Permissions.ReflectionPermissionFlag.RestrictedMemberAccess> allows access to non-public members, with the restriction that the grant set of the non-public members must be equal to, or a subset of, the grant set of the code that accesses the non-public members.
Certain features of reflection emit, such as emitting debug symbols, require <xref:System.Security.Permissions.ReflectionPermission> with the <xref:System.Security.Permissions.ReflectionPermissionFlag.ReflectionEmit?displayProperty=nameWithType> flag.
For more information, see the <xref:System.Security.Permissions.ReflectionPermissionFlag> enumeration.
]]></format>
</remarks>
<altmember cref="T:System.Security.Permissions.ReflectionPermissionFlag" />
<altmember cref="T:System.Security.Permissions.ReflectionPermissionAttribute" />
<related type="Article" href="~/docs/framework/reflection-and-codedom/security-considerations-for-reflection.md">Security Considerations for Reflection</related>
<related type="Article" href="~/docs/framework/reflection-and-codedom/security-issues-in-reflection-emit.md">Security Issues in Reflection Emit</related>
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Security.Permissions.ReflectionPermission" /> class.</summary>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ReflectionPermission (System.Security.Permissions.PermissionState state);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(valuetype System.Security.Permissions.PermissionState state) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Permissions.ReflectionPermission.#ctor(System.Security.Permissions.PermissionState)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (state As PermissionState)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; ReflectionPermission(System::Security::Permissions::PermissionState state);" />
<MemberSignature Language="F#" Value="new System.Security.Permissions.ReflectionPermission : System.Security.Permissions.PermissionState -&gt; System.Security.Permissions.ReflectionPermission" Usage="new System.Security.Permissions.ReflectionPermission state" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Permissions</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="state" Type="System.Security.Permissions.PermissionState" />
</Parameters>
<Docs>
<param name="state">One of the <see cref="T:System.Security.Permissions.PermissionState" /> values.</param>
<summary>Initializes a new instance of the <see cref="T:System.Security.Permissions.ReflectionPermission" /> class with either fully restricted or unrestricted permission as specified.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Creates either fully restricted (`None`) or `Unrestricted` access to metadata.
## Examples
The following code example shows the use of the <xref:System.Security.Permissions.ReflectionPermission.%23ctor%28System.Security.Permissions.PermissionState%29?displayProperty=nameWithType> constructor. This example is part of a larger example provided for the <xref:System.Security.Permissions.ReflectionPermission> class.
[!code-csharp[System.Security.Permissions.ReflectionPermission#7](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Security.Permissions.ReflectionPermission/CS/reflectionpermission.cs#7)]
[!code-vb[System.Security.Permissions.ReflectionPermission#7](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Security.Permissions.ReflectionPermission/VB/reflectionpermission.vb#7)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The <paramref name="state" /> parameter is not a valid value of <see cref="T:System.Security.Permissions.PermissionState" />.</exception>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ReflectionPermission (System.Security.Permissions.ReflectionPermissionFlag flag);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(valuetype System.Security.Permissions.ReflectionPermissionFlag flag) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Permissions.ReflectionPermission.#ctor(System.Security.Permissions.ReflectionPermissionFlag)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (flag As ReflectionPermissionFlag)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; ReflectionPermission(System::Security::Permissions::ReflectionPermissionFlag flag);" />
<MemberSignature Language="F#" Value="new System.Security.Permissions.ReflectionPermission : System.Security.Permissions.ReflectionPermissionFlag -&gt; System.Security.Permissions.ReflectionPermission" Usage="new System.Security.Permissions.ReflectionPermission flag" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Permissions</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="flag" Type="System.Security.Permissions.ReflectionPermissionFlag" />
</Parameters>
<Docs>
<param name="flag">One of the <see cref="T:System.Security.Permissions.ReflectionPermissionFlag" /> values.</param>
<summary>Initializes a new instance of the <see cref="T:System.Security.Permissions.ReflectionPermission" /> class with the specified access.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example shows the use of the <xref:System.Security.Permissions.ReflectionPermission.%23ctor%28System.Security.Permissions.ReflectionPermissionFlag%29?displayProperty=nameWithType> constructor. This example is part of a larger example provided for the <xref:System.Security.Permissions.ReflectionPermission> class.
[!code-csharp[System.Security.Permissions.ReflectionPermission#8](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Security.Permissions.ReflectionPermission/CS/reflectionpermission.cs#8)]
[!code-vb[System.Security.Permissions.ReflectionPermission#8](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Security.Permissions.ReflectionPermission/VB/reflectionpermission.vb#8)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The <paramref name="flag" /> parameter is not a valid value of <see cref="T:System.Security.Permissions.ReflectionPermissionFlag" />.</exception>
</Docs>
</Member>
<Member MemberName="Copy">
<MemberSignature Language="C#" Value="public override System.Security.IPermission Copy ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.Security.IPermission Copy() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Permissions.ReflectionPermission.Copy" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function Copy () As IPermission" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override System::Security::IPermission ^ Copy();" />
<MemberSignature Language="F#" Value="override this.Copy : unit -&gt; System.Security.IPermission" Usage="reflectionPermission.Copy " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Permissions</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Security.IPermission</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates and returns an identical copy of the current permission.</summary>
<returns>A copy of the current permission.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
A copy of a permission represents the same access to resources as the original permission.
## Examples
The following code example shows the behavior of the <xref:System.Security.Permissions.ReflectionPermission.Copy%2A> method. This example is part of a larger example provided for the <xref:System.Security.Permissions.ReflectionPermission> class.
> [!NOTE]
> The code example is intended to show the behavior of the method, not to demonstrate its use. In general, the methods of permission classes are used by the security infrastructure; they are not typically used in applications.
[!code-csharp[System.Security.Permissions.ReflectionPermission#5](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Security.Permissions.ReflectionPermission/CS/reflectionpermission.cs#5)]
[!code-vb[System.Security.Permissions.ReflectionPermission#5](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Security.Permissions.ReflectionPermission/VB/reflectionpermission.vb#5)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Flags">
<MemberSignature Language="C#" Value="public System.Security.Permissions.ReflectionPermissionFlag Flags { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Security.Permissions.ReflectionPermissionFlag Flags" />
<MemberSignature Language="DocId" Value="P:System.Security.Permissions.ReflectionPermission.Flags" />
<MemberSignature Language="VB.NET" Value="Public Property Flags As ReflectionPermissionFlag" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Security::Permissions::ReflectionPermissionFlag Flags { System::Security::Permissions::ReflectionPermissionFlag get(); void set(System::Security::Permissions::ReflectionPermissionFlag value); };" />
<MemberSignature Language="F#" Value="member this.Flags : System.Security.Permissions.ReflectionPermissionFlag with get, set" Usage="System.Security.Permissions.ReflectionPermission.Flags" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Permissions</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Security.Permissions.ReflectionPermissionFlag</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the type of reflection allowed for the current permission.</summary>
<value>The set flags for the current permission.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example shows the use of the <xref:System.Security.Permissions.ReflectionPermission.Flags%2A> property. This example is part of a larger example provided for the <xref:System.Security.Permissions.ReflectionPermission> class.
[!code-csharp[System.Security.Permissions.ReflectionPermission#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Security.Permissions.ReflectionPermission/CS/reflectionpermission.cs#2)]
[!code-vb[System.Security.Permissions.ReflectionPermission#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Security.Permissions.ReflectionPermission/VB/reflectionpermission.vb#2)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">An attempt is made to set this property to an invalid value. See <see cref="T:System.Security.Permissions.ReflectionPermissionFlag" /> for the valid values.</exception>
</Docs>
</Member>
<Member MemberName="FromXml">
<MemberSignature Language="C#" Value="public override void FromXml (System.Security.SecurityElement esd);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void FromXml(class System.Security.SecurityElement esd) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Permissions.ReflectionPermission.FromXml(System.Security.SecurityElement)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Sub FromXml (esd As SecurityElement)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override void FromXml(System::Security::SecurityElement ^ esd);" />
<MemberSignature Language="F#" Value="override this.FromXml : System.Security.SecurityElement -&gt; unit" Usage="reflectionPermission.FromXml esd" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Permissions</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="esd" Type="System.Security.SecurityElement" />
</Parameters>
<Docs>
<param name="esd">The XML encoding to use to reconstruct the permission.</param>
<summary>Reconstructs a permission with a specified state from an XML encoding.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example shows the behavior of the <xref:System.Security.Permissions.ReflectionPermission.FromXml%2A> method. This example is part of a larger example provided for the <xref:System.Security.Permissions.ReflectionPermission> class.
> [!NOTE]
> The code example is intended to show the behavior of the method, not to demonstrate its use. In general, the methods of permission classes are used by the security infrastructure; they are not typically used in applications.
[!code-csharp[System.Security.Permissions.ReflectionPermission#6](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Security.Permissions.ReflectionPermission/CS/reflectionpermission.cs#6)]
[!code-vb[System.Security.Permissions.ReflectionPermission#6](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Security.Permissions.ReflectionPermission/VB/reflectionpermission.vb#6)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="esd" /> parameter is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="esd" /> parameter is not a valid permission element.
-or-
The <paramref name="esd" /> parameter's version number is not valid.</exception>
</Docs>
</Member>
<Member MemberName="Intersect">
<MemberSignature Language="C#" Value="public override System.Security.IPermission Intersect (System.Security.IPermission target);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.Security.IPermission Intersect(class System.Security.IPermission target) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Permissions.ReflectionPermission.Intersect(System.Security.IPermission)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function Intersect (target As IPermission) As IPermission" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override System::Security::IPermission ^ Intersect(System::Security::IPermission ^ target);" />
<MemberSignature Language="F#" Value="override this.Intersect : System.Security.IPermission -&gt; System.Security.IPermission" Usage="reflectionPermission.Intersect target" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Permissions</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Security.IPermission</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="target" Type="System.Security.IPermission" />
</Parameters>
<Docs>
<param name="target">A permission to intersect with the current permission. It must be of the same type as the current permission.</param>
<summary>Creates and returns a permission that is the intersection of the current permission and the specified permission.</summary>
<returns>A new permission that represents the intersection of the current permission and the specified permission. This new permission is <see langword="null" /> if the intersection is empty.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The intersection of two permissions is a permission that describes the set of operations they both describe in common. Only a demand that passes both original permissions will pass the intersection.
## Examples
The following code example shows the behavior of the <xref:System.Security.Permissions.ReflectionPermission.Intersect%2A> method. This example is part of a larger example provided for the <xref:System.Security.Permissions.ReflectionPermission> class.
> [!NOTE]
> The code example is intended to show the behavior of the method, not to demonstrate its use. In general, the methods of permission classes are used by the security infrastructure; they are not typically used in applications.
[!code-csharp[System.Security.Permissions.ReflectionPermission#4](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Security.Permissions.ReflectionPermission/CS/reflectionpermission.cs#4)]
[!code-vb[System.Security.Permissions.ReflectionPermission#4](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Security.Permissions.ReflectionPermission/VB/reflectionpermission.vb#4)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The <paramref name="target" /> parameter is not <see langword="null" /> and is not of the same type as the current permission.</exception>
</Docs>
</Member>
<Member MemberName="IsSubsetOf">
<MemberSignature Language="C#" Value="public override bool IsSubsetOf (System.Security.IPermission target);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance bool IsSubsetOf(class System.Security.IPermission target) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Permissions.ReflectionPermission.IsSubsetOf(System.Security.IPermission)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function IsSubsetOf (target As IPermission) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override bool IsSubsetOf(System::Security::IPermission ^ target);" />
<MemberSignature Language="F#" Value="override this.IsSubsetOf : System.Security.IPermission -&gt; bool" Usage="reflectionPermission.IsSubsetOf target" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Permissions</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="target" Type="System.Security.IPermission" />
</Parameters>
<Docs>
<param name="target">A permission that is to be tested for the subset relationship. This permission must be of the same type as the current permission.</param>
<summary>Determines whether the current permission is a subset of the specified permission.</summary>
<returns>
<see langword="true" /> if the current permission is a subset of the specified permission; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The current permission is a subset of the specified permission if the current permission specifies a set of operations that is wholly contained by the specified permission. For example, a permission that represents access to C:\example.txt is a subset of a permission that represents access to C:\\. If this method returns `true`, the current permission represents no more access to the protected resource than does the specified permission.
## Examples
The following code example shows the behavior of the <xref:System.Security.Permissions.ReflectionPermission.IsSubsetOf%2A> method. This example is part of a larger example provided for the <xref:System.Security.Permissions.ReflectionPermission> class.
> [!NOTE]
> The code example is intended to show the behavior of the method, not to demonstrate its use. In general, the methods of permission classes are used by the security infrastructure; they are not typically used in applications.
[!code-csharp[System.Security.Permissions.ReflectionPermission#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Security.Permissions.ReflectionPermission/CS/reflectionpermission.cs#2)]
[!code-vb[System.Security.Permissions.ReflectionPermission#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Security.Permissions.ReflectionPermission/VB/reflectionpermission.vb#2)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The <paramref name="target" /> parameter is not <see langword="null" /> and is not of the same type as the current permission.</exception>
</Docs>
</Member>
<Member MemberName="IsUnrestricted">
<MemberSignature Language="C#" Value="public bool IsUnrestricted ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool IsUnrestricted() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Permissions.ReflectionPermission.IsUnrestricted" />
<MemberSignature Language="VB.NET" Value="Public Function IsUnrestricted () As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual bool IsUnrestricted();" />
<MemberSignature Language="F#" Value="abstract member IsUnrestricted : unit -&gt; bool&#xA;override this.IsUnrestricted : unit -&gt; bool" Usage="reflectionPermission.IsUnrestricted " FrameworkAlternate="dotnet-plat-ext-2.1;dotnet-plat-ext-2.2;dotnet-plat-ext-3.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8" />
<MemberSignature Language="F#" Value="override this.IsUnrestricted : unit -&gt; bool" Usage="reflectionPermission.IsUnrestricted " FrameworkAlternate="xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Security.Permissions.IUnrestrictedPermission.IsUnrestricted</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Permissions</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns a value indicating whether the current permission is unrestricted.</summary>
<returns>
<see langword="true" /> if the current permission is unrestricted; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
An unrestricted permission represents access to any and all resources protected by the permission.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ToXml">
<MemberSignature Language="C#" Value="public override System.Security.SecurityElement ToXml ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.Security.SecurityElement ToXml() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Permissions.ReflectionPermission.ToXml" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function ToXml () As SecurityElement" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override System::Security::SecurityElement ^ ToXml();" />
<MemberSignature Language="F#" Value="override this.ToXml : unit -&gt; System.Security.SecurityElement" Usage="reflectionPermission.ToXml " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Permissions</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Security.SecurityElement</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates an XML encoding of the permission and its current state.</summary>
<returns>An XML encoding of the permission, including any state information.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example shows the behavior of the <xref:System.Security.Permissions.ReflectionPermission.ToXml%2A> method. This example is part of a larger example provided for the <xref:System.Security.Permissions.ReflectionPermission> class.
> [!NOTE]
> The code example is intended to show the behavior of the method, not to demonstrate its use. In general, the methods of permission classes are used by the security infrastructure; they are not typically used in applications.
[!code-csharp[System.Security.Permissions.ReflectionPermission#6](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Security.Permissions.ReflectionPermission/CS/reflectionpermission.cs#6)]
[!code-vb[System.Security.Permissions.ReflectionPermission#6](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Security.Permissions.ReflectionPermission/VB/reflectionpermission.vb#6)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Union">
<MemberSignature Language="C#" Value="public override System.Security.IPermission Union (System.Security.IPermission other);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.Security.IPermission Union(class System.Security.IPermission other) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Security.Permissions.ReflectionPermission.Union(System.Security.IPermission)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function Union (other As IPermission) As IPermission" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override System::Security::IPermission ^ Union(System::Security::IPermission ^ other);" />
<MemberSignature Language="F#" Value="override this.Union : System.Security.IPermission -&gt; System.Security.IPermission" Usage="reflectionPermission.Union other" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Security.Permissions</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Security.IPermission</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="other" Type="System.Security.IPermission" />
</Parameters>
<Docs>
<param name="other">A permission to combine with the current permission. It must be of the same type as the current permission.</param>
<summary>Creates a permission that is the union of the current permission and the specified permission.</summary>
<returns>A new permission that represents the union of the current permission and the specified permission.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The result of a call to <xref:System.Security.Permissions.ReflectionPermission.Union%2A> is a permission that represents all the operations represented by both the current permission and the specified permission. Any demand that passes either permission passes their union.
## Examples
The following code example shows the behavior of the <xref:System.Security.Permissions.ReflectionPermission.Union%2A> method. This example is part of a larger example provided for the <xref:System.Security.Permissions.ReflectionPermission> class.
> [!NOTE]
> The code example is intended to show the behavior of the method, not to demonstrate its use. In general, the methods of permission classes are used by the security infrastructure; they are not typically used in applications.
[!code-csharp[System.Security.Permissions.ReflectionPermission#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Security.Permissions.ReflectionPermission/CS/reflectionpermission.cs#3)]
[!code-vb[System.Security.Permissions.ReflectionPermission#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Security.Permissions.ReflectionPermission/VB/reflectionpermission.vb#3)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The <paramref name="other" /> parameter is not <see langword="null" /> and is not of the same type as the current permission.</exception>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.