IPermission.Copy Method

Definition

Creates and returns an identical copy of the current permission.

C#
public System.Security.IPermission Copy();

Returns

A copy of the current permission.

Examples

The following code example demonstrates implementing the Copy method. This code example is part of a larger example provided for the IPermission interface.

C#
// Return a new object that matches 'this' object's permissions.
public sealed override IPermission Copy()
{
    return (IPermission)Clone();
}

Remarks

A copy of a permission represents the same access to resources as the original permission.

Applies to

Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1