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); } }