TraceUtility.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / Diagnostics / TraceUtility.cs / 1 / TraceUtility.cs

                            //------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------

namespace System.IdentityModel.Diagnostics 
{
    using System.Diagnostics; 
    using System.Runtime.CompilerServices; 
    using System.ServiceModel.Diagnostics;
 
    internal static class TraceUtility
    {
        static string Description(TraceCode traceCode)
        { 
            // This method's validity is checked via a BVT at
            // ddsuites\src\indigo\Suites\diagnostics\Tracing\TraceCodeVerification 
            string descriptionKey = "TraceCode" + DiagnosticTrace.CodeToString(traceCode); 
            return SR.GetString(descriptionKey);
        } 

        internal static void TraceEvent(TraceEventType severity, TraceCode traceCode, object source, Exception exception)
        {
            TraceEvent(severity, traceCode, null, source, exception); 
        }
 
        // These methods require a TraceRecord to be allocated, so we want them to show up on profiles if the caller didn't avoid 
        // allocating the TraceRecord by using ShouldTrace.
        [MethodImpl(MethodImplOptions.NoInlining)] 
        internal static void TraceEvent(TraceEventType severity, TraceCode traceCode, TraceRecord extendedData, object source, Exception exception)
        {
            if (DiagnosticUtility.ShouldTrace(severity))
            { 
                Guid activityId = DiagnosticTrace.ActivityId;
                DiagnosticUtility.DiagnosticTrace.TraceEvent(severity, traceCode, Description(traceCode), extendedData, exception, activityId, source); 
            } 
        }
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.


                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK