ContentUser Klasa

Definicja

Reprezentuje użytkownika lub grupę użytkowników w celu udzielenia dostępu do zawartości zarządzanej prawami.

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
Dziedziczenie
ContentUser
Atrybuty

Przykłady

W poniższym przykładzie pokazano, jak za pomocą Owner właściwości przypisać zmienną tego 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

Uwagi

Podobnie jak w przypadku innych System.Security.RightsManagement typów, ContentUser można używać tylko w aplikacjach o pełnym zaufaniu.

Konstruktory

ContentUser(String, AuthenticationType)

Inicjuje nowe wystąpienie klasy ContentUser.

Właściwości

AnyoneUser

Pobiera wystąpienie osoby "Każdy". ContentUser

AuthenticationType

AuthenticationType Pobiera określony do konstruktoraContentUser(String, AuthenticationType).

Name

Pobiera nazwę użytkownika lub grupy określoną dla konstruktora ContentUser(String, AuthenticationType) .

OwnerUser

Pobiera wystąpienie osoby "Właściciel". ContentUser

Metody

Equals(Object)

Zwraca wartość wskazującą, czy jest to ContentUser równoważne innemu wystąpieniu.

GetHashCode()

Zwraca obliczony kod skrótu na podstawie użytkownika Name i AuthenticationType.

GetType()

Type Pobiera bieżące wystąpienie.

(Odziedziczone po Object)
IsAuthenticated()

Zwraca wartość wskazującą, czy użytkownik jest obecnie uwierzytelniony.

MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
ToString()

Zwraca ciąg reprezentujący bieżący obiekt.

(Odziedziczone po Object)

Dotyczy