SmtpPermission.IsSubsetOf(IPermission) Método

Definição

Retorna um valor que indica se a permissão atual é um subconjunto da permissão especificada.Returns a value indicating whether the current permission is a subset of the specified permission.

public:
 override bool IsSubsetOf(System::Security::IPermission ^ target);
public override bool IsSubsetOf (System.Security.IPermission target);
override this.IsSubsetOf : System.Security.IPermission -> bool
Public Overrides Function IsSubsetOf (target As IPermission) As Boolean

Parâmetros

target
IPermission

Um IPermission que será testado para a relação de subconjunto.An IPermission that is to be tested for the subset relationship. Essa permissão deve ser do mesmo tipo da permissão atual.This permission must be of the same type as the current permission.

Retornos

Boolean

true se a permissão atual for um subconjunto da permissão especificada; caso contrário, false.true if the current permission is a subset of the specified permission; otherwise, false.

Exceções

target não é um SmtpPermission.target is not an SmtpPermission.

Exemplos

O exemplo de código a seguir exibe a relação de subconjunto entre duas permissões.The following code example displays the subset relationship between two permissions.

static bool CheckSubSet(
    SmtpPermission^ permission)
{
    SmtpPermission^ allAccess = 
        gcnew SmtpPermission(PermissionState::Unrestricted);
    return permission->IsSubsetOf(allAccess);
}
public static bool CheckSubSet(SmtpPermission permission)
{
    SmtpPermission allAccess = new
        SmtpPermission(System.Security.Permissions.PermissionState.Unrestricted);
    return permission.IsSubsetOf(allAccess);
}

Comentários

A permissão atual é um subconjunto da permissão especificada se a permissão atual especifica um estado que está totalmente contido pela permissão especificada.The current permission is a subset of the specified permission if the current permission specifies a state that is wholly contained by the specified permission. Se esse método retornar true , a permissão atual não representará mais acesso ao recurso protegido do que a permissão especificada.If this method returns true, the current permission represents no more access to the protected resource than does the specified permission.

Aplica-se a