IPermission.Copy 方法

定义

创建并返回当前权限的相同副本。

public:
 System::Security::IPermission ^ Copy();
public System.Security.IPermission Copy ();
abstract member Copy : unit -> System.Security.IPermission
Public Function Copy () As IPermission

返回

当前权限的副本。

示例

下面的代码示例演示如何实现 Copy 方法。 此代码示例是为 接口提供的更大示例的 IPermission 一部分。

    // Return a new object that matches 'this' object's permissions.
public:
    virtual IPermission^ Copy () override sealed
    {
        return (IPermission^) Clone();
    }
// Return a new object that matches 'this' object's permissions.
public sealed override IPermission Copy()
{
    return (IPermission)Clone();
}
' Return a new object that matches 'this' object's permissions.
Public Overrides Function Copy() As IPermission
    Return CType(Clone(), IPermission)

End Function 'Copy

注解

权限的副本表示对资源的访问权限与原始权限相同。

适用于