示例#1
0
 private void InitializeProcessName()
 {
     if (UnmanagedCodePermissionAvailable)
     {
         ProcessName = LogEntryContext.GetProcessNameSafe();
     }
     else
     {
         ProcessName = string.Format(CultureInfo.CurrentCulture,
                                     Properties.Resources.IntrinsicPropertyError,
                                     Properties.Resources.LogEntryIntrinsicPropertyNoUnmanagedCodePermissionError);
     }
 }
示例#2
0
 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);
     }
 }
示例#3
0
 private void InitializeMachineName()
 {
     MachineName = LogEntryContext.GetMachineNameSafe();
 }
示例#4
0
 private void InitializeAppDomainName()
 {
     AppDomainName = LogEntryContext.GetAppDomainNameSafe();
 }
示例#5
0
 /// <summary>
 /// Gets the current process name.
 /// </summary>
 /// <returns>The process name.</returns>
 public static string GetProcessName()
 {
     return(LogEntryContext.GetProcessName());
 }