Imports System.Threading Namespace State ''' ''' Helper Class to hold User State ''' Public Class UserState Public Const LANG_DE_DE As String = "de-DE" Public Const LANG_EN_US As String = "en-US" ''' ''' Numeric UserId, ex. 1 ''' Public Property UserId As Integer ''' ''' The windows username, ex. JenneJ ''' ''' Public Property UserName As String ''' ''' The user's surname, ex. Jenne ''' Public Property Surname As String ''' ''' The user's given name, ex. Jonathan ''' Public Property GivenName As String ''' ''' The shortname given to the user, ex. JJ ''' Public Property ShortName As String ''' ''' The user's email address ''' Public Property Email As String ''' ''' The user's windows machine name, ex. DD-PC-ENT04 ''' Public Property MachineName As String ''' ''' The users preferred date format, ex. dd-MM-yyyy ''' Public Property DateFormat As String ''' ''' The user's language code, ex. de-DE ''' Public Property Language As String ''' ''' The user's language id, what is this? ''' Public Property LanguageId As Integer ''' ''' Is the user a general administrator? ''' ''' Public Property IsAdmin As Boolean = False ''' ''' Should basic config (DB Settings) be hidden from this user? ''' ''' Public Property HideBasicConfig As Boolean = False ''' ''' Initialize user object with values that can be read from the environment. Only meant for Global Application State ''' Public Sub New() Language = Thread.CurrentThread.CurrentCulture.Name UserName = System.Environment.UserName MachineName = System.Environment.MachineName End Sub ''' ''' Initialize user object with user name. Mandatory for sending user data between systems. ''' Public Sub New(pUserName As String) MyBase.New() UserName = pUserName End Sub End Class End Namespace