File: TD.Designer.cs
Project: ndp\cdf\src\WCF\Serialization\System.Runtime.Serialization.csproj (System.Runtime.Serialization)
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
 
namespace System.Runtime.Serialization.Diagnostics.Application
{
    using System.Runtime;
    using System.Runtime.Diagnostics;
    using System.Security;
    
    
    internal partial class TD
    {
        
        static System.Resources.ResourceManager resourceManager;
        
        static System.Globalization.CultureInfo resourceCulture;
        
        [System.Security.SecurityCriticalAttribute()]
        static System.Runtime.Diagnostics.EventDescriptor[] eventDescriptors;
        
        static object syncLock = new object();
        
        // Double-checked locking pattern requires volatile for read/write synchronization
        static volatile bool eventDescriptorsCreated;
        
        private TD()
        {
        }
        
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification="This is an auto-generated code, some ETW/TraceSource mixed code would use it.")]
        static System.Resources.ResourceManager ResourceManager
        {
            get
            {
                if (object.ReferenceEquals(resourceManager, null))
                {
                    resourceManager = new System.Resources.ResourceManager("System.Runtime.Serialization.Diagnostics.Application.TD", typeof(TD).Assembly);
                }
                return resourceManager;
            }
        }
        
        [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification="This template is shared across all assemblies, some of which use this accessor.")]
        internal static System.Globalization.CultureInfo Culture
        {
            get
            {
                return resourceCulture;
            }
            set
            {
                resourceCulture = value;
            }
        }
        
        /// <summary>
        /// Check if trace definition is enabled
        /// Event description ID=1420, Level=error, Channel=analytic
        /// </summary>
        internal static bool ReaderQuotaExceededIsEnabled()
        {
            return (FxTrace.ShouldTraceError && TD.IsEtwEventEnabled(0));
        }
        
        /// <summary>
        /// Gets trace definition like: {0}
        /// Event description ID=1420, Level=error, Channel=analytic
        /// </summary>
        /// <param name="param0">Parameter 0 for event: {0}</param>
        internal static void ReaderQuotaExceeded(string param0)
        {
            TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
            if (TD.IsEtwEventEnabled(0))
            {
                TD.WriteEtwEvent(0, null, param0, payload.AppDomainFriendlyName);
            }
        }
        
        /// <summary>
        /// Check if trace definition is enabled
        /// Event description ID=5001, Level=Verbose, Channel=Debug
        /// </summary>
        internal static bool DCSerializeWithSurrogateStartIsEnabled()
        {
            return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(1));
        }
        
        /// <summary>
        /// Gets trace definition like: DataContract serialize {0} with surrogates start.
        /// Event description ID=5001, Level=Verbose, Channel=Debug
        /// </summary>
        /// <param name="SurrogateType">Parameter 0 for event: DataContract serialize {0} with surrogates start.</param>
        internal static void DCSerializeWithSurrogateStart(string SurrogateType)
        {
            TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
            if (TD.IsEtwEventEnabled(1))
            {
                TD.WriteEtwEvent(1, null, SurrogateType, payload.AppDomainFriendlyName);
            }
        }
        
        /// <summary>
        /// Check if trace definition is enabled
        /// Event description ID=5002, Level=Verbose, Channel=Debug
        /// </summary>
        internal static bool DCSerializeWithSurrogateStopIsEnabled()
        {
            return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(2));
        }
        
        /// <summary>
        /// Gets trace definition like: DataContract serialize with surrogates stop.
        /// Event description ID=5002, Level=Verbose, Channel=Debug
        /// </summary>
        internal static void DCSerializeWithSurrogateStop()
        {
            TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
            if (TD.IsEtwEventEnabled(2))
            {
                TD.WriteEtwEvent(2, null, payload.AppDomainFriendlyName);
            }
        }
        
        /// <summary>
        /// Check if trace definition is enabled
        /// Event description ID=5003, Level=Verbose, Channel=Debug
        /// </summary>
        internal static bool DCDeserializeWithSurrogateStartIsEnabled()
        {
            return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(3));
        }
        
        /// <summary>
        /// Gets trace definition like: DataContract deserialize {0} with surrogates start.
        /// Event description ID=5003, Level=Verbose, Channel=Debug
        /// </summary>
        /// <param name="SurrogateType">Parameter 0 for event: DataContract deserialize {0} with surrogates start.</param>
        internal static void DCDeserializeWithSurrogateStart(string SurrogateType)
        {
            TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
            if (TD.IsEtwEventEnabled(3))
            {
                TD.WriteEtwEvent(3, null, SurrogateType, payload.AppDomainFriendlyName);
            }
        }
        
        /// <summary>
        /// Check if trace definition is enabled
        /// Event description ID=5004, Level=Verbose, Channel=Debug
        /// </summary>
        internal static bool DCDeserializeWithSurrogateStopIsEnabled()
        {
            return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(4));
        }
        
        /// <summary>
        /// Gets trace definition like: DataContract deserialize with surrogates stop.
        /// Event description ID=5004, Level=Verbose, Channel=Debug
        /// </summary>
        internal static void DCDeserializeWithSurrogateStop()
        {
            TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
            if (TD.IsEtwEventEnabled(4))
            {
                TD.WriteEtwEvent(4, null, payload.AppDomainFriendlyName);
            }
        }
        
        /// <summary>
        /// Check if trace definition is enabled
        /// Event description ID=5005, Level=Verbose, Channel=Debug
        /// </summary>
        internal static bool ImportKnownTypesStartIsEnabled()
        {
            return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(5));
        }
        
        /// <summary>
        /// Gets trace definition like: ImportKnownTypes start.
        /// Event description ID=5005, Level=Verbose, Channel=Debug
        /// </summary>
        internal static void ImportKnownTypesStart()
        {
            TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
            if (TD.IsEtwEventEnabled(5))
            {
                TD.WriteEtwEvent(5, null, payload.AppDomainFriendlyName);
            }
        }
        
        /// <summary>
        /// Check if trace definition is enabled
        /// Event description ID=5006, Level=Verbose, Channel=Debug
        /// </summary>
        internal static bool ImportKnownTypesStopIsEnabled()
        {
            return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(6));
        }
        
        /// <summary>
        /// Gets trace definition like: ImportKnownTypes stop.
        /// Event description ID=5006, Level=Verbose, Channel=Debug
        /// </summary>
        internal static void ImportKnownTypesStop()
        {
            TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
            if (TD.IsEtwEventEnabled(6))
            {
                TD.WriteEtwEvent(6, null, payload.AppDomainFriendlyName);
            }
        }
        
        /// <summary>
        /// Check if trace definition is enabled
        /// Event description ID=5007, Level=Verbose, Channel=Debug
        /// </summary>
        internal static bool DCResolverResolveIsEnabled()
        {
            return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(7));
        }
        
        /// <summary>
        /// Gets trace definition like: DataContract resolver resolving {0} start.
        /// Event description ID=5007, Level=Verbose, Channel=Debug
        /// </summary>
        /// <param name="TypeName">Parameter 0 for event: DataContract resolver resolving {0} start.</param>
        internal static void DCResolverResolve(string TypeName)
        {
            TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
            if (TD.IsEtwEventEnabled(7))
            {
                TD.WriteEtwEvent(7, null, TypeName, payload.AppDomainFriendlyName);
            }
        }
        
        /// <summary>
        /// Check if trace definition is enabled
        /// Event description ID=5008, Level=Verbose, Channel=Debug
        /// </summary>
        internal static bool DCGenWriterStartIsEnabled()
        {
            return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(8));
        }
        
        /// <summary>
        /// Gets trace definition like: DataContract generate {0} writer for {1} start.
        /// Event description ID=5008, Level=Verbose, Channel=Debug
        /// </summary>
        /// <param name="Kind">Parameter 0 for event: DataContract generate {0} writer for {1} start.</param>
        /// <param name="TypeName">Parameter 1 for event: DataContract generate {0} writer for {1} start.</param>
        internal static void DCGenWriterStart(string Kind, string TypeName)
        {
            TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
            if (TD.IsEtwEventEnabled(8))
            {
                TD.WriteEtwEvent(8, null, Kind, TypeName, payload.AppDomainFriendlyName);
            }
        }
        
        /// <summary>
        /// Check if trace definition is enabled
        /// Event description ID=5009, Level=Verbose, Channel=Debug
        /// </summary>
        internal static bool DCGenWriterStopIsEnabled()
        {
            return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(9));
        }
        
        /// <summary>
        /// Gets trace definition like: DataContract generate writer stop.
        /// Event description ID=5009, Level=Verbose, Channel=Debug
        /// </summary>
        internal static void DCGenWriterStop()
        {
            TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
            if (TD.IsEtwEventEnabled(9))
            {
                TD.WriteEtwEvent(9, null, payload.AppDomainFriendlyName);
            }
        }
        
        /// <summary>
        /// Check if trace definition is enabled
        /// Event description ID=5010, Level=Verbose, Channel=Debug
        /// </summary>
        internal static bool DCGenReaderStartIsEnabled()
        {
            return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(10));
        }
        
        /// <summary>
        /// Gets trace definition like: DataContract generate {0} reader for {1} start.
        /// Event description ID=5010, Level=Verbose, Channel=Debug
        /// </summary>
        /// <param name="Kind">Parameter 0 for event: DataContract generate {0} reader for {1} start.</param>
        /// <param name="TypeName">Parameter 1 for event: DataContract generate {0} reader for {1} start.</param>
        internal static void DCGenReaderStart(string Kind, string TypeName)
        {
            TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
            if (TD.IsEtwEventEnabled(10))
            {
                TD.WriteEtwEvent(10, null, Kind, TypeName, payload.AppDomainFriendlyName);
            }
        }
        
        /// <summary>
        /// Check if trace definition is enabled
        /// Event description ID=5011, Level=Verbose, Channel=Debug
        /// </summary>
        internal static bool DCGenReaderStopIsEnabled()
        {
            return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(11));
        }
        
        /// <summary>
        /// Gets trace definition like: DataContract generation stop.
        /// Event description ID=5011, Level=Verbose, Channel=Debug
        /// </summary>
        internal static void DCGenReaderStop()
        {
            TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
            if (TD.IsEtwEventEnabled(11))
            {
                TD.WriteEtwEvent(11, null, payload.AppDomainFriendlyName);
            }
        }
        
        /// <summary>
        /// Check if trace definition is enabled
        /// Event description ID=5012, Level=Verbose, Channel=Debug
        /// </summary>
        internal static bool DCJsonGenReaderStartIsEnabled()
        {
            return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(12));
        }
        
        /// <summary>
        /// Gets trace definition like: Json generate {0} reader for {1} start.
        /// Event description ID=5012, Level=Verbose, Channel=Debug
        /// </summary>
        /// <param name="Kind">Parameter 0 for event: Json generate {0} reader for {1} start.</param>
        /// <param name="TypeName">Parameter 1 for event: Json generate {0} reader for {1} start.</param>
        internal static void DCJsonGenReaderStart(string Kind, string TypeName)
        {
            TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
            if (TD.IsEtwEventEnabled(12))
            {
                TD.WriteEtwEvent(12, null, Kind, TypeName, payload.AppDomainFriendlyName);
            }
        }
        
        /// <summary>
        /// Check if trace definition is enabled
        /// Event description ID=5013, Level=Verbose, Channel=Debug
        /// </summary>
        internal static bool DCJsonGenReaderStopIsEnabled()
        {
            return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(13));
        }
        
        /// <summary>
        /// Gets trace definition like: Json reader generation stop.
        /// Event description ID=5013, Level=Verbose, Channel=Debug
        /// </summary>
        internal static void DCJsonGenReaderStop()
        {
            TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
            if (TD.IsEtwEventEnabled(13))
            {
                TD.WriteEtwEvent(13, null, payload.AppDomainFriendlyName);
            }
        }
        
        /// <summary>
        /// Check if trace definition is enabled
        /// Event description ID=5014, Level=Verbose, Channel=Debug
        /// </summary>
        internal static bool DCJsonGenWriterStartIsEnabled()
        {
            return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(14));
        }
        
        /// <summary>
        /// Gets trace definition like: Json generate {0} writer for {1} start.
        /// Event description ID=5014, Level=Verbose, Channel=Debug
        /// </summary>
        /// <param name="Kind">Parameter 0 for event: Json generate {0} writer for {1} start.</param>
        /// <param name="TypeName">Parameter 1 for event: Json generate {0} writer for {1} start.</param>
        internal static void DCJsonGenWriterStart(string Kind, string TypeName)
        {
            TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
            if (TD.IsEtwEventEnabled(14))
            {
                TD.WriteEtwEvent(14, null, Kind, TypeName, payload.AppDomainFriendlyName);
            }
        }
        
        /// <summary>
        /// Check if trace definition is enabled
        /// Event description ID=5015, Level=Verbose, Channel=Debug
        /// </summary>
        internal static bool DCJsonGenWriterStopIsEnabled()
        {
            return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(15));
        }
        
        /// <summary>
        /// Gets trace definition like: Json generate writer stop.
        /// Event description ID=5015, Level=Verbose, Channel=Debug
        /// </summary>
        internal static void DCJsonGenWriterStop()
        {
            TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
            if (TD.IsEtwEventEnabled(15))
            {
                TD.WriteEtwEvent(15, null, payload.AppDomainFriendlyName);
            }
        }
        
        /// <summary>
        /// Check if trace definition is enabled
        /// Event description ID=5016, Level=Verbose, Channel=Debug
        /// </summary>
        internal static bool GenXmlSerializableStartIsEnabled()
        {
            return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(16));
        }
        
        /// <summary>
        /// Gets trace definition like: Generate Xml serializable for '{0}' start.
        /// Event description ID=5016, Level=Verbose, Channel=Debug
        /// </summary>
        /// <param name="DCType">Parameter 0 for event: Generate Xml serializable for '{0}' start.</param>
        internal static void GenXmlSerializableStart(string DCType)
        {
            TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
            if (TD.IsEtwEventEnabled(16))
            {
                TD.WriteEtwEvent(16, null, DCType, payload.AppDomainFriendlyName);
            }
        }
        
        /// <summary>
        /// Check if trace definition is enabled
        /// Event description ID=5017, Level=Verbose, Channel=Debug
        /// </summary>
        internal static bool GenXmlSerializableStopIsEnabled()
        {
            return (FxTrace.ShouldTraceVerbose && TD.IsEtwEventEnabled(17));
        }
        
        /// <summary>
        /// Gets trace definition like: Generate Xml serializable stop.
        /// Event description ID=5017, Level=Verbose, Channel=Debug
        /// </summary>
        internal static void GenXmlSerializableStop()
        {
            TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
            if (TD.IsEtwEventEnabled(17))
            {
                TD.WriteEtwEvent(17, null, payload.AppDomainFriendlyName);
            }
        }
        
        /// <summary>
        /// Creates the event descriptors array
        /// </summary>
        // Critical = Sets the SecurityCritical member eventDescriptors
        // Safe = We control what the event descriptors contain
        [System.Security.SecuritySafeCriticalAttribute()]
        static void CreateEventDescriptors()
        {
            System.Runtime.Diagnostics.EventDescriptor[] descriptors = new System.Runtime.Diagnostics.EventDescriptor[] {
                    new System.Runtime.Diagnostics.EventDescriptor(1420, 0, (byte)TraceChannel.Analytic, (byte)TraceEventLevel.Error, (byte)TraceEventOpcode.Info, 0xa00, 0x2000000000400000),
                    new System.Runtime.Diagnostics.EventDescriptor(5001, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Start, 0xa20, 0x1000000000000002),
                    new System.Runtime.Diagnostics.EventDescriptor(5002, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Stop, 0xa20, 0x1000000000000002),
                    new System.Runtime.Diagnostics.EventDescriptor(5003, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Start, 0xa1f, 0x1000000000000002),
                    new System.Runtime.Diagnostics.EventDescriptor(5004, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Stop, 0xa1f, 0x1000000000000002),
                    new System.Runtime.Diagnostics.EventDescriptor(5005, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Start, 0x9f3, 0x1000000000000002),
                    new System.Runtime.Diagnostics.EventDescriptor(5006, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Stop, 0x9f3, 0x1000000000000002),
                    new System.Runtime.Diagnostics.EventDescriptor(5007, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Start, 0x9e0, 0x1000000000000002),
                    new System.Runtime.Diagnostics.EventDescriptor(5008, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Start, 0x9f0, 0x1000000000000002),
                    new System.Runtime.Diagnostics.EventDescriptor(5009, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Stop, 0x9f0, 0x1000000000000002),
                    new System.Runtime.Diagnostics.EventDescriptor(5010, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Start, 0x9ef, 0x1000000000000002),
                    new System.Runtime.Diagnostics.EventDescriptor(5011, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Stop, 0x9ef, 0x1000000000000002),
                    new System.Runtime.Diagnostics.EventDescriptor(5012, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Start, 0x9ef, 0x1000000000000002),
                    new System.Runtime.Diagnostics.EventDescriptor(5013, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Stop, 0x9ef, 0x1000000000000002),
                    new System.Runtime.Diagnostics.EventDescriptor(5014, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Start, 0x9f0, 0x1000000000000002),
                    new System.Runtime.Diagnostics.EventDescriptor(5015, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Stop, 0x9f0, 0x1000000000000002),
                    new System.Runtime.Diagnostics.EventDescriptor(5016, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Start, 0x9f1, 0x1000000000000002),
                    new System.Runtime.Diagnostics.EventDescriptor(5017, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)TraceEventOpcode.Stop, 0x9f1, 0x1000000000000002)};
            ushort[] e2eEvents = new ushort[0];
            FxTrace.UpdateEventDefinitions(descriptors, e2eEvents);
            eventDescriptors = descriptors;
        }
        
        /// <summary>
        /// Ensures that the event descriptors array is initialized
        /// </summary>
        static void EnsureEventDescriptors()
        {
            if (eventDescriptorsCreated)
            {
                return;
            }
            System.Threading.Monitor.Enter(syncLock);
            try
            {
                if (eventDescriptorsCreated)
                {
                    return;
                }
                CreateEventDescriptors();
                eventDescriptorsCreated = true;
            }
            finally
            {
                System.Threading.Monitor.Exit(syncLock);
            }
        }
        
        /// <summary>
        /// Check if ETW tracing is enabled for the particular event
        /// </summary>
        /// <param name="eventIndex">The index of the event descriptor</param>
        static bool IsEtwEventEnabled(int eventIndex)
        {
            if (FxTrace.Trace.IsEtwProviderEnabled)
            {
                EnsureEventDescriptors();
                return FxTrace.IsEventEnabled(eventIndex);
            }
            return false;
        }
        
        /// <summary>
        /// Writes ETW trace event
        ///</summary>
        /// <param name="eventIndex">The index of the event descriptor</param>>
        /// <param name="eventParam0">A parameter of the ETW event</param>>
        /// <param name="eventParam1">A parameter of the ETW event</param>>
        /// <param name="eventParam2">A parameter of the ETW event</param>>
        // Critical = Calls SecurityCritical method EtwProvider.WriteEvent
        // Safe = We only allow setting of provider id from SecurityCritical code, access to EventDescriptors is SecurityCritical, and ETW limits buffer sizes.
        [System.Security.SecuritySafeCriticalAttribute()]
        static bool WriteEtwEvent(int eventIndex, System.Runtime.Diagnostics.EventTraceActivity eventParam0, string eventParam1, string eventParam2)
        {
            EnsureEventDescriptors();
            return FxTrace.Trace.EtwProvider.WriteEvent(ref eventDescriptors[eventIndex], eventParam0, eventParam1, eventParam2);
        }
        
        /// <summary>
        /// Writes ETW trace event
        ///</summary>
        /// <param name="eventIndex">The index of the event descriptor</param>>
        /// <param name="eventParam0">A parameter of the ETW event</param>>
        /// <param name="eventParam1">A parameter of the ETW event</param>>
        // Critical = Calls SecurityCritical method EtwProvider.WriteEvent
        // Safe = We only allow setting of provider id from SecurityCritical code, access to EventDescriptors is SecurityCritical, and ETW limits buffer sizes.
        [System.Security.SecuritySafeCriticalAttribute()]
        static bool WriteEtwEvent(int eventIndex, System.Runtime.Diagnostics.EventTraceActivity eventParam0, string eventParam1)
        {
            EnsureEventDescriptors();
            return FxTrace.Trace.EtwProvider.WriteEvent(ref eventDescriptors[eventIndex], eventParam0, eventParam1);
        }
        
        /// <summary>
        /// Writes ETW trace event
        ///</summary>
        /// <param name="eventIndex">The index of the event descriptor</param>>
        /// <param name="eventParam0">A parameter of the ETW event</param>>
        /// <param name="eventParam1">A parameter of the ETW event</param>>
        /// <param name="eventParam2">A parameter of the ETW event</param>>
        /// <param name="eventParam3">A parameter of the ETW event</param>>
        // Critical = Calls SecurityCritical method EtwProvider.WriteEvent
        // Safe = We only allow setting of provider id from SecurityCritical code, access to EventDescriptors is SecurityCritical, and ETW limits buffer sizes.
        [System.Security.SecuritySafeCriticalAttribute()]
        static bool WriteEtwEvent(int eventIndex, System.Runtime.Diagnostics.EventTraceActivity eventParam0, string eventParam1, string eventParam2, string eventParam3)
        {
            EnsureEventDescriptors();
            return FxTrace.Trace.EtwProvider.WriteEvent(ref eventDescriptors[eventIndex], eventParam0, eventParam1, eventParam2, eventParam3);
        }
    }
}