Export (0) Print
Expand All

ContentUser Class

Represents a user or user-group for granting access to rights managed content.

System.Object
  System.Security.RightsManagement.ContentUser

Namespace:  System.Security.RightsManagement
Assembly:  WindowsBase (in WindowsBase.dll)

public class ContentUser

The ContentUser type exposes the following members.

  NameDescription
Public methodContentUserInitializes a new instance of the ContentUser class.
Top

  NameDescription
Public propertyStatic memberAnyoneUserGets an instance of the "Anyone" ContentUser persona.
Public propertyAuthenticationTypeGets the AuthenticationType specified to the ContentUser constructor.
Public propertyNameGets the user or group name specified to the ContentUser constructor.
Public propertyStatic memberOwnerUserGets an instance of the "Owner" ContentUser persona.
Top

  NameDescription
Public methodEqualsReturns a value that indicates whether this ContentUser is equivalent to another given instance. (Overrides Object.Equals(Object).)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeReturns a computed hash code based on the user Name and AuthenticationType. (Overrides Object.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodIsAuthenticatedReturns a value that indicates whether the user is currently authenticated.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

As with other System.Security.RightsManagement types, ContentUser is only usable in full trust applications.

The following example shows how to use Owner property to assign a variable of this type.


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;


.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft