private void InitializeProcessName() { if (UnmanagedCodePermissionAvailable) { ProcessName = LogEntryContext.GetProcessNameSafe(); } else { ProcessName = string.Format(CultureInfo.CurrentCulture, Properties.Resources.IntrinsicPropertyError, Properties.Resources.LogEntryIntrinsicPropertyNoUnmanagedCodePermissionError); } }
private void InitializeWin32ThreadId() { if (UnmanagedCodePermissionAvailable) { try { Win32ThreadId = LogEntryContext.GetCurrentThreadId(); } catch (Exception e) { Win32ThreadId = string.Format(CultureInfo.CurrentCulture, Properties.Resources.IntrinsicPropertyError, e.Message); } } else { Win32ThreadId = string.Format(CultureInfo.CurrentCulture, Properties.Resources.IntrinsicPropertyError, Properties.Resources.LogEntryIntrinsicPropertyNoUnmanagedCodePermissionError); } }
private void InitializeMachineName() { MachineName = LogEntryContext.GetMachineNameSafe(); }
private void InitializeAppDomainName() { AppDomainName = LogEntryContext.GetAppDomainNameSafe(); }
/// <summary> /// Gets the current process name. /// </summary> /// <returns>The process name.</returns> public static string GetProcessName() { return(LogEntryContext.GetProcessName()); }