ContentUser Třída
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
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 použít Owner vlastnost 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 je možné používat pouze v aplikacích s plnou důvěryhodností.
Konstruktory
| Name | Description |
|---|---|
| ContentUser(String, AuthenticationType) |
Inicializuje novou instanci ContentUser třídy. |
Vlastnosti
| Name | Description |
|---|---|
| AnyoneUser |
Získá instanci osoby "Anyone" ContentUser (Kdokoli). |
| 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 osoby "Owner" ContentUser . |
Metody
| Name | Description |
|---|---|
| Equals(Object) |
Vrátí hodnotu, která určuje, jestli je to ContentUser ekvivalentní jiné dané instanci. |
| GetHashCode() |
Vrátí vypočítaný hash kód založený na uživateli Name a AuthenticationType. |
| GetType() |
Získá Type aktuální instance. (Zděděno od Object) |
| IsAuthenticated() |
Vrátí hodnotu, která určuje, jestli je uživatel aktuálně ověřený. |
| MemberwiseClone() |
Vytvoří mělkou kopii aktuálního Object. (Zděděno od Object) |
| ToString() |
Vrátí řetězec, který představuje aktuální objekt. (Zděděno od Object) |