Export (0) Print
Expand All

UserActivationMode Enumeration

Specifies the type of user Rights Account Certificate to request for rights management activation.

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

public enum UserActivationMode
<object property="enumerationMemberName" .../>

Member nameDescription
PermanentA permanent Rights Account Certificate.
TemporaryA temporary Rights Account Certificate.

Used as a parameter to the Create method of a SecureEnvironment, UserActivationMode specifies to request either a Temporary or Permanent Rights Account Certificate.

The following example shows how to use this enumeration to create a SecureEnvironment.

string applicationManifest = "<manifest></manifest>";
if (File.Exists("rpc.xml"))
{
    StreamReader manifestReader = File.OpenText("rpc.xml");
    applicationManifest = manifestReader.ReadToEnd();
}

if (_secureEnv == null)
{
    if (SecureEnvironment.IsUserActivated(new ContentUser(
                _currentUserId, AuthenticationType.Windows)))
    {
        _secureEnv = SecureEnvironment.Create(
            applicationManifest, new ContentUser(
                _currentUserId, AuthenticationType.Windows));
    }
    else
    {
        _secureEnv = SecureEnvironment.Create(
            applicationManifest,
            AuthenticationType.Windows,
            UserActivationMode.Permanent);
    }
}

For the complete example, see the Rights Managed Package Publish Sample.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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

.NET Framework

Supported in: 3.5, 3.0

Community Additions

ADD
Show:
© 2014 Microsoft