Sdílet prostřednictvím


ContentUser Třída

Definice

Představuje uživatele nebo skupinu uživatelů pro udělení přístupu k obsahu spravovanému právy.

public ref class ContentUser
[System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)]
public class ContentUser
public class ContentUser
[<System.Security.SecurityCritical(System.Security.SecurityCriticalScope.Everything)>]
type ContentUser = class
type ContentUser = class
Public Class ContentUser
Dědičnost
ContentUser
Atributy

Příklady

Následující příklad ukazuje, jak pomocí Owner vlastnosti přiřadit proměnnou tohoto typu.

WriteStatus("   Reading '" + xrmlFilename + "' permissions.");
try
{
    StreamReader sr = File.OpenText(xrmlFile);
    xrmlString = sr.ReadToEnd();
}
catch (Exception ex)
{
    MessageBox.Show("ERROR: '"+xrmlFilename+"' open failed.\n"+
        "Exception: " + ex.Message, "XrML File Error",
        MessageBoxButton.OK, MessageBoxImage.Error);
    return false;
}

WriteStatus("   Building UnsignedPublishLicense");
WriteStatus("       from '" + xrmlFilename + "'.");
UnsignedPublishLicense unsignedLicense =
    new UnsignedPublishLicense(xrmlString);
ContentUser author = unsignedLicense.Owner;
WriteStatus("   Reading '" & xrmlFilename & "' permissions.")
Try
    Dim sr As StreamReader = File.OpenText(xrmlFile)
    xrmlString = sr.ReadToEnd()
Catch ex As Exception
    MessageBox.Show("ERROR: '" & xrmlFilename &"' open failed." & vbLf & "Exception: " & ex.Message, "XrML File Error", MessageBoxButton.OK, MessageBoxImage.Error)
    Return False
End Try

WriteStatus("   Building UnsignedPublishLicense")
WriteStatus("       from '" & xrmlFilename & "'.")
Dim unsignedLicense As New UnsignedPublishLicense(xrmlString)
Dim author As ContentUser = unsignedLicense.Owner

Poznámky

Stejně jako u jiných System.Security.RightsManagement typů ContentUser se dá použít jenom v aplikacích s plnou důvěryhodností.

Konstruktory

ContentUser(String, AuthenticationType)

Inicializuje novou instanci ContentUser třídy .

Vlastnosti

AnyoneUser

Získá instanci "Anyone" ContentUser persona.

AuthenticationType

AuthenticationType Získá zadaný konstruktorContentUser(String, AuthenticationType).

Name

Získá název uživatele nebo skupiny zadané konstruktoru ContentUser(String, AuthenticationType) .

OwnerUser

Získá instanci "Vlastník" ContentUser osoby.

Metody

Equals(Object)

Vrátí hodnotu, která označuje, zda je ekvivalentní ContentUser k jiné dané instanci.

GetHashCode()

Vrátí vypočítaný kód hash na základě uživatele Name a AuthenticationType.

GetType()

Type Získá z aktuální instance.

(Zděděno od Object)
IsAuthenticated()

Vrátí hodnotu, která označuje, jestli je uživatel aktuálně ověřený.

MemberwiseClone()

Vytvoří mělkou kopii aktuálního Objectsouboru .

(Zděděno od Object)
ToString()

Vrátí řetězec, který představuje aktuální objekt.

(Zděděno od Object)

Platí pro