Xafari Service. Logon and Logoff

By default, the service is not user dependent. If the initialization or the functioning of a service depends on a current user, the service should be implemented as CurrentUserDependent. To do that, override the virtual IsCurrentUserDependent property to return the True value.

  • c#
  • VB

public override bool IsCurrentUserDependent
{
  get
  {
    return true;
  }
}

Public Overrides ReadOnly Property IsCurrentUserDependent As Boolean
  Get
    Return True
  End Get
End Property

Such service cannot be activated until the user successfully logs into the application. When the user logs out, such service is automatically reset and deactivated.

The IsLoggedOn property of the service stores the info about successful user authentication.

To perform specific operations dealing with user authentication, override the LoggedOn(), LoggedOff(), and LogonFailed() virtual methods.