Public Member Functions | |
Administrator () | |
Creates a new instance. | |
bool | Impersonate () |
Impersonates the current user to an Administrator. | |
void | Deimpersonate () |
Resets the current Thread to the current user. | |
Static Public Member Functions | |
static string | GetErrorMessage (int errorCode) |
Helper method to request an error message for a given error number from the OS. | |
Private Member Functions | |
bool | login () |
Creates a LoginToken for an administrator. | |
bool | IsAdministrator (IntPtr loginToken) |
Check whether the user is part of the administrator group. | |
Private Attributes | |
ResourceManager | messages = null |
A private ResourceManager for handling internationalization. | |
IntPtr | loginToken = new IntPtr(0) |
The LoginToken of a Administrator or null. | |
WindowsImpersonationContext | impersonatedUser = null |
The WindowsImpersonationContext after impersonation to an Administrator, used to "De"-Impersonate. | |
Static Private Attributes | |
static readonly ILog | log = LogManager.GetLogger(typeof(Administrator)) |
The private Logger. |
ServicesCtl.Administrator.Administrator | ( | ) |
Creates a new instance.
Initializes the ResourceManager Administrator.messages.
bool ServicesCtl.Administrator.login | ( | ) | [private] |
Creates a LoginToken for an administrator.
bool ServicesCtl.Administrator.Impersonate | ( | ) |
Impersonates the current user to an Administrator.
void ServicesCtl.Administrator.Deimpersonate | ( | ) |
Resets the current Thread to the current user.
bool ServicesCtl.Administrator.IsAdministrator | ( | IntPtr | loginToken | ) | [private] |
Check whether the user is part of the administrator group.
loginToken | the LoginToken to check |
static string ServicesCtl.Administrator.GetErrorMessage | ( | int | errorCode | ) | [static] |
Helper method to request an error message for a given error number from the OS.
errorCode | The Error code |
ResourceManager ServicesCtl.Administrator.messages = null [private] |
A private ResourceManager for handling internationalization.
IntPtr ServicesCtl.Administrator.loginToken = new IntPtr(0) [private] |
The LoginToken of a Administrator or null.
WindowsImpersonationContext ServicesCtl.Administrator.impersonatedUser = null [private] |
The WindowsImpersonationContext after impersonation to an Administrator, used to "De"-Impersonate.
readonly ILog ServicesCtl.Administrator.log = LogManager.GetLogger(typeof(Administrator)) [static, private] |
The private Logger.