Exemplo n.º 1
0
 private void InitializeActivityId()
 {
     try
     {
         this.ActivityId = LogEntryContext.GetActivityId();
     }
     catch (Exception)
     {
         this.ActivityId = Guid.Empty;
     }
 }
Exemplo n.º 2
0
 private void InitializeProcessName()
 {
     if (this.UnmanagedCodePermissionAvailable)
     {
         this.ProcessName = LogEntryContext.GetProcessNameSafe();
     }
     else
     {
         this.ProcessName = string.Format(CultureInfo.CurrentCulture,
                                          Properties.Resources.IntrinsicPropertyError,
                                          Properties.Resources.LogEntryIntrinsicPropertyNoUnmanagedCodePermissionError);
     }
 }
Exemplo n.º 3
0
 private void InitializeActivityId()
 {
     if (Tracer.IsTracingAvailable())
     {
         try
         {
             this.ActivityId = LogEntryContext.GetActivityId();
         }
         catch (Exception)
         {
             this.ActivityId = Guid.Empty;
         }
     }
     else
     {
         this.ActivityId = Guid.Empty;
     }
 }
Exemplo n.º 4
0
 private void InitializeWin32ThreadId()
 {
     if (!LogEntry.isFullyTrusted)
     {
         this.Win32ThreadId = string.Format(CultureInfo.CurrentCulture,
                                            Properties.Resources.IntrinsicPropertyError,
                                            Properties.Resources.LogEntryIntrinsicPropertyNotFullyTrusted);
     }
     else if (!this.UnmanagedCodePermissionAvailable)
     {
         this.Win32ThreadId = string.Format(CultureInfo.CurrentCulture,
                                            Properties.Resources.IntrinsicPropertyError,
                                            Properties.Resources.LogEntryIntrinsicPropertyNoUnmanagedCodePermissionError);
     }
     else
     {
         this.Win32ThreadId = LogEntryContext.GetCurrentThreadIdSafe();
     }
 }
Exemplo n.º 5
0
 private void InitializeWin32ThreadId()
 {
     if (this.UnmanagedCodePermissionAvailable)
     {
         try
         {
             this.Win32ThreadId = LogEntryContext.GetCurrentThreadId();
         }
         catch (Exception e)
         {
             this.Win32ThreadId = string.Format(CultureInfo.CurrentCulture, Properties.Resources.IntrinsicPropertyError, e.Message);
         }
     }
     else
     {
         this.Win32ThreadId = string.Format(CultureInfo.CurrentCulture,
                                            Properties.Resources.IntrinsicPropertyError,
                                            Properties.Resources.LogEntryIntrinsicPropertyNoUnmanagedCodePermissionError);
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// Gets the current process name.
 /// </summary>
 /// <returns>The process name.</returns>
 public static string GetProcessName()
 {
     return(LogEntryContext.GetProcessNameSafe());
 }
Exemplo n.º 7
0
 private void InitializeAppDomainName()
 {
     this.AppDomainName = LogEntryContext.GetAppDomainNameSafe();
 }
Exemplo n.º 8
0
 private void InitializeMachineName()
 {
     this.MachineName = LogEntryContext.GetMachineNameSafe();
 }