Merge pull request #2955 from ludovic-henry/mono_msec_ticks-overflow
[mono.git] / mcs / class / referencesource / System.ServiceModel.Discovery / TD.Designer.cs
1 //------------------------------------------------------------------------------
2 // <auto-generated>
3 //     This code was generated by a tool.
4 //
5 //     Changes to this file may cause incorrect behavior and will be lost if
6 //     the code is regenerated.
7 // </auto-generated>
8 //------------------------------------------------------------------------------
9
10 namespace System.ServiceModel.Discovery
11 {
12     using System.Runtime;
13     using System.Runtime.Diagnostics;
14     using System.Security;
15     
16     
17     internal partial class TD
18     {
19         
20         static System.Resources.ResourceManager resourceManager;
21         
22         static System.Globalization.CultureInfo resourceCulture;
23         
24         [System.Security.SecurityCriticalAttribute()]
25         static System.Runtime.Diagnostics.EventDescriptor[] eventDescriptors;
26         
27         static object syncLock = new object();
28         
29         // Double-checked locking pattern requires volatile for read/write synchronization
30         static volatile bool eventDescriptorsCreated;
31         
32         private TD()
33         {
34         }
35         
36         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification="This is an auto-generated code, some ETW/TraceSource mixed code would use it.")]
37         static System.Resources.ResourceManager ResourceManager
38         {
39             get
40             {
41                 if (object.ReferenceEquals(resourceManager, null))
42                 {
43                     resourceManager = new System.Resources.ResourceManager("System.ServiceModel.Discovery.TD", typeof(TD).Assembly);
44                 }
45                 return resourceManager;
46             }
47         }
48         
49         [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification="This template is shared across all assemblies, some of which use this accessor.")]
50         internal static System.Globalization.CultureInfo Culture
51         {
52             get
53             {
54                 return resourceCulture;
55             }
56             set
57             {
58                 resourceCulture = value;
59             }
60         }
61         
62         /// <summary>
63         /// Check if trace definition is enabled
64         /// Event description ID=4801, Level=Warning, Channel=debug
65         /// </summary>
66         internal static bool DiscoveryClientInClientChannelFailedToCloseIsEnabled()
67         {
68             return (FxTrace.ShouldTraceWarning 
69                         && (FxTrace.ShouldTraceWarningToTraceSource || TD.IsEtwEventEnabled(0)));
70         }
71         
72         /// <summary>
73         /// Gets trace definition like: The DiscoveryClient created inside DiscoveryClientChannel failed to close and hence has been aborted.
74         /// Event description ID=4801, Level=Warning, Channel=debug
75         /// </summary>
76         /// <param name="exception">Exception associated with the event</param>
77         internal static void DiscoveryClientInClientChannelFailedToClose(System.Exception exception)
78         {
79             TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, exception);
80             if (TD.IsEtwEventEnabled(0))
81             {
82                 TD.WriteEtwEvent(0, null, payload.SerializedException, payload.AppDomainFriendlyName);
83             }
84             if (FxTrace.ShouldTraceWarningToTraceSource)
85             {
86                 string description = string.Format(Culture, ResourceManager.GetString("DiscoveryClientInClientChannelFailedToClose", Culture));
87                 TD.WriteTraceSource(0, description, payload);
88             }
89         }
90         
91         /// <summary>
92         /// Check if trace definition is enabled
93         /// Event description ID=4802, Level=Informational, Channel=debug
94         /// </summary>
95         internal static bool DiscoveryClientProtocolExceptionSuppressedIsEnabled()
96         {
97             return (FxTrace.ShouldTraceInformation 
98                         && (FxTrace.ShouldTraceInformationToTraceSource || TD.IsEtwEventEnabled(1)));
99         }
100         
101         /// <summary>
102         /// Gets trace definition like: A ProtocolException was suppressed while closing the DiscoveryClient. This could be because a DiscoveryService is still trying to send response to the DiscoveryClient.
103         /// Event description ID=4802, Level=Informational, Channel=debug
104         /// </summary>
105         /// <param name="exception">Exception associated with the event</param>
106         internal static void DiscoveryClientProtocolExceptionSuppressed(System.Exception exception)
107         {
108             TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, exception);
109             if (TD.IsEtwEventEnabled(1))
110             {
111                 TD.WriteEtwEvent(1, null, payload.SerializedException, payload.AppDomainFriendlyName);
112             }
113             if (FxTrace.ShouldTraceInformationToTraceSource)
114             {
115                 string description = string.Format(Culture, ResourceManager.GetString("DiscoveryClientProtocolExceptionSuppressed", Culture));
116                 TD.WriteTraceSource(1, description, payload);
117             }
118         }
119         
120         /// <summary>
121         /// Check if trace definition is enabled
122         /// Event description ID=4803, Level=Informational, Channel=debug
123         /// </summary>
124         internal static bool DiscoveryClientReceivedMulticastSuppressionIsEnabled()
125         {
126             return (FxTrace.ShouldTraceInformation 
127                         && (FxTrace.ShouldTraceInformationToTraceSource || TD.IsEtwEventEnabled(2)));
128         }
129         
130         /// <summary>
131         /// Gets trace definition like: The DiscoveryClient received a multicast suppression message from a DiscoveryProxy.
132         /// Event description ID=4803, Level=Informational, Channel=debug
133         /// </summary>
134         internal static void DiscoveryClientReceivedMulticastSuppression()
135         {
136             TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
137             if (TD.IsEtwEventEnabled(2))
138             {
139                 TD.WriteEtwEvent(2, null, payload.AppDomainFriendlyName);
140             }
141             if (FxTrace.ShouldTraceInformationToTraceSource)
142             {
143                 string description = string.Format(Culture, ResourceManager.GetString("DiscoveryClientReceivedMulticastSuppression", Culture));
144                 TD.WriteTraceSource(2, description, payload);
145             }
146         }
147         
148         /// <summary>
149         /// Check if trace definition is enabled
150         /// Event description ID=4804, Level=Informational, Channel=debug
151         /// </summary>
152         internal static bool DiscoveryMessageReceivedAfterOperationCompletedIsEnabled()
153         {
154             return (FxTrace.ShouldTraceInformation 
155                         && (FxTrace.ShouldTraceInformationToTraceSource || TD.IsEtwEventEnabled(3)));
156         }
157         
158         /// <summary>
159         /// Gets trace definition like: A {0} message with messageId='{1}' was dropped by the DiscoveryClient because the corresponding {2} operation was completed.
160         /// Event description ID=4804, Level=Informational, Channel=debug
161         /// </summary>
162         /// <param name="eventTraceActivity">The event trace activity</param>
163         /// <param name="discoveryMessageName">Parameter 0 for event: A {0} message with messageId='{1}' was dropped by the DiscoveryClient because the corresponding {2} operation was completed.</param>
164         /// <param name="messageId">Parameter 1 for event: A {0} message with messageId='{1}' was dropped by the DiscoveryClient because the corresponding {2} operation was completed.</param>
165         /// <param name="discoveryOperationName">Parameter 2 for event: A {0} message with messageId='{1}' was dropped by the DiscoveryClient because the corresponding {2} operation was completed.</param>
166         internal static void DiscoveryMessageReceivedAfterOperationCompleted(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity, string discoveryMessageName, string messageId, string discoveryOperationName)
167         {
168             TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
169             if (TD.IsEtwEventEnabled(3))
170             {
171                 TD.WriteEtwEvent(3, eventTraceActivity, discoveryMessageName, messageId, discoveryOperationName, payload.AppDomainFriendlyName);
172             }
173             if (FxTrace.ShouldTraceInformationToTraceSource)
174             {
175                 string description = string.Format(Culture, ResourceManager.GetString("DiscoveryMessageReceivedAfterOperationCompleted", Culture), discoveryMessageName, messageId, discoveryOperationName);
176                 TD.WriteTraceSource(3, description, payload);
177             }
178         }
179         
180         /// <summary>
181         /// Check if trace definition is enabled
182         /// Event description ID=4805, Level=Warning, Channel=debug
183         /// </summary>
184         internal static bool DiscoveryMessageWithInvalidContentIsEnabled()
185         {
186             return (FxTrace.ShouldTraceWarning 
187                         && (FxTrace.ShouldTraceWarningToTraceSource || TD.IsEtwEventEnabled(4)));
188         }
189         
190         /// <summary>
191         /// Gets trace definition like: A {0} message with messageId='{1}' was dropped because it had invalid content.
192         /// Event description ID=4805, Level=Warning, Channel=debug
193         /// </summary>
194         /// <param name="eventTraceActivity">The event trace activity</param>
195         /// <param name="messageType">Parameter 0 for event: A {0} message with messageId='{1}' was dropped because it had invalid content.</param>
196         /// <param name="messageId">Parameter 1 for event: A {0} message with messageId='{1}' was dropped because it had invalid content.</param>
197         internal static void DiscoveryMessageWithInvalidContent(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity, string messageType, string messageId)
198         {
199             TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
200             if (TD.IsEtwEventEnabled(4))
201             {
202                 TD.WriteEtwEvent(4, eventTraceActivity, messageType, messageId, payload.AppDomainFriendlyName);
203             }
204             if (FxTrace.ShouldTraceWarningToTraceSource)
205             {
206                 string description = string.Format(Culture, ResourceManager.GetString("DiscoveryMessageWithInvalidContent", Culture), messageType, messageId);
207                 TD.WriteTraceSource(4, description, payload);
208             }
209         }
210         
211         /// <summary>
212         /// Check if trace definition is enabled
213         /// Event description ID=4806, Level=Warning, Channel=debug
214         /// </summary>
215         internal static bool DiscoveryMessageWithInvalidRelatesToOrOperationCompletedIsEnabled()
216         {
217             return (FxTrace.ShouldTraceWarning 
218                         && (FxTrace.ShouldTraceWarningToTraceSource || TD.IsEtwEventEnabled(5)));
219         }
220         
221         /// <summary>
222         /// Gets trace definition like: A {0} message with messageId='{1}' and relatesTo='{2}' was dropped by the DiscoveryClient because either the corresponding {3} operation was completed or the relatesTo value is invalid.
223         /// Event description ID=4806, Level=Warning, Channel=debug
224         /// </summary>
225         /// <param name="eventTraceActivity">The event trace activity</param>
226         /// <param name="discoveryMessageName">Parameter 0 for event: A {0} message with messageId='{1}' and relatesTo='{2}' was dropped by the DiscoveryClient because either the corresponding {3} operation was completed or the relatesTo value is invalid.</param>
227         /// <param name="messageId">Parameter 1 for event: A {0} message with messageId='{1}' and relatesTo='{2}' was dropped by the DiscoveryClient because either the corresponding {3} operation was completed or the relatesTo value is invalid.</param>
228         /// <param name="relatesTo">Parameter 2 for event: A {0} message with messageId='{1}' and relatesTo='{2}' was dropped by the DiscoveryClient because either the corresponding {3} operation was completed or the relatesTo value is invalid.</param>
229         /// <param name="discoveryOperationName">Parameter 3 for event: A {0} message with messageId='{1}' and relatesTo='{2}' was dropped by the DiscoveryClient because either the corresponding {3} operation was completed or the relatesTo value is invalid.</param>
230         internal static void DiscoveryMessageWithInvalidRelatesToOrOperationCompleted(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity, string discoveryMessageName, string messageId, string relatesTo, string discoveryOperationName)
231         {
232             TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
233             if (TD.IsEtwEventEnabled(5))
234             {
235                 TD.WriteEtwEvent(5, eventTraceActivity, discoveryMessageName, messageId, relatesTo, discoveryOperationName, payload.AppDomainFriendlyName);
236             }
237             if (FxTrace.ShouldTraceWarningToTraceSource)
238             {
239                 string description = string.Format(Culture, ResourceManager.GetString("DiscoveryMessageWithInvalidRelatesToOrOperationCompleted", Culture), discoveryMessageName, messageId, relatesTo, discoveryOperationName);
240                 TD.WriteTraceSource(5, description, payload);
241             }
242         }
243         
244         /// <summary>
245         /// Check if trace definition is enabled
246         /// Event description ID=4807, Level=Warning, Channel=debug
247         /// </summary>
248         internal static bool DiscoveryMessageWithInvalidReplyToIsEnabled()
249         {
250             return (FxTrace.ShouldTraceWarning 
251                         && (FxTrace.ShouldTraceWarningToTraceSource || TD.IsEtwEventEnabled(6)));
252         }
253         
254         /// <summary>
255         /// Gets trace definition like: A discovery request message with messageId='{0}' was dropped because it had an invalid ReplyTo address.
256         /// Event description ID=4807, Level=Warning, Channel=debug
257         /// </summary>
258         /// <param name="eventTraceActivity">The event trace activity</param>
259         /// <param name="messageId">Parameter 0 for event: A discovery request message with messageId='{0}' was dropped because it had an invalid ReplyTo address.</param>
260         internal static void DiscoveryMessageWithInvalidReplyTo(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity, string messageId)
261         {
262             TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
263             if (TD.IsEtwEventEnabled(6))
264             {
265                 TD.WriteEtwEvent(6, eventTraceActivity, messageId, payload.AppDomainFriendlyName);
266             }
267             if (FxTrace.ShouldTraceWarningToTraceSource)
268             {
269                 string description = string.Format(Culture, ResourceManager.GetString("DiscoveryMessageWithInvalidReplyTo", Culture), messageId);
270                 TD.WriteTraceSource(6, description, payload);
271             }
272         }
273         
274         /// <summary>
275         /// Check if trace definition is enabled
276         /// Event description ID=4808, Level=Warning, Channel=debug
277         /// </summary>
278         internal static bool DiscoveryMessageWithNoContentIsEnabled()
279         {
280             return (FxTrace.ShouldTraceWarning 
281                         && (FxTrace.ShouldTraceWarningToTraceSource || TD.IsEtwEventEnabled(7)));
282         }
283         
284         /// <summary>
285         /// Gets trace definition like: A {0} message was dropped because it did not have any content.
286         /// Event description ID=4808, Level=Warning, Channel=debug
287         /// </summary>
288         /// <param name="eventTraceActivity">The event trace activity</param>
289         /// <param name="messageType">Parameter 0 for event: A {0} message was dropped because it did not have any content.</param>
290         internal static void DiscoveryMessageWithNoContent(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity, string messageType)
291         {
292             TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
293             if (TD.IsEtwEventEnabled(7))
294             {
295                 TD.WriteEtwEvent(7, eventTraceActivity, messageType, payload.AppDomainFriendlyName);
296             }
297             if (FxTrace.ShouldTraceWarningToTraceSource)
298             {
299                 string description = string.Format(Culture, ResourceManager.GetString("DiscoveryMessageWithNoContent", Culture), messageType);
300                 TD.WriteTraceSource(7, description, payload);
301             }
302         }
303         
304         /// <summary>
305         /// Check if trace definition is enabled
306         /// Event description ID=4809, Level=Warning, Channel=debug
307         /// </summary>
308         internal static bool DiscoveryMessageWithNullMessageIdIsEnabled()
309         {
310             return (FxTrace.ShouldTraceWarning 
311                         && (FxTrace.ShouldTraceWarningToTraceSource || TD.IsEtwEventEnabled(8)));
312         }
313         
314         /// <summary>
315         /// Gets trace definition like: A {0} message was dropped because the message header did not contain the required MessageId property.
316         /// Event description ID=4809, Level=Warning, Channel=debug
317         /// </summary>
318         /// <param name="eventTraceActivity">The event trace activity</param>
319         /// <param name="messageType">Parameter 0 for event: A {0} message was dropped because the message header did not contain the required MessageId property.</param>
320         internal static void DiscoveryMessageWithNullMessageId(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity, string messageType)
321         {
322             TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
323             if (TD.IsEtwEventEnabled(8))
324             {
325                 TD.WriteEtwEvent(8, eventTraceActivity, messageType, payload.AppDomainFriendlyName);
326             }
327             if (FxTrace.ShouldTraceWarningToTraceSource)
328             {
329                 string description = string.Format(Culture, ResourceManager.GetString("DiscoveryMessageWithNullMessageId", Culture), messageType);
330                 TD.WriteTraceSource(8, description, payload);
331             }
332         }
333         
334         /// <summary>
335         /// Check if trace definition is enabled
336         /// Event description ID=4810, Level=Warning, Channel=debug
337         /// </summary>
338         internal static bool DiscoveryMessageWithNullMessageSequenceIsEnabled()
339         {
340             return (FxTrace.ShouldTraceWarning 
341                         && (FxTrace.ShouldTraceWarningToTraceSource || TD.IsEtwEventEnabled(9)));
342         }
343         
344         /// <summary>
345         /// Gets trace definition like: A {0} message with messageId='{1}' was dropped by the DiscoveryClient because it did not have the DiscoveryMessageSequence property.
346         /// Event description ID=4810, Level=Warning, Channel=debug
347         /// </summary>
348         /// <param name="discoveryMessageName">Parameter 0 for event: A {0} message with messageId='{1}' was dropped by the DiscoveryClient because it did not have the DiscoveryMessageSequence property.</param>
349         /// <param name="messageId">Parameter 1 for event: A {0} message with messageId='{1}' was dropped by the DiscoveryClient because it did not have the DiscoveryMessageSequence property.</param>
350         internal static void DiscoveryMessageWithNullMessageSequence(string discoveryMessageName, string messageId)
351         {
352             TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
353             if (TD.IsEtwEventEnabled(9))
354             {
355                 TD.WriteEtwEvent(9, null, discoveryMessageName, messageId, payload.AppDomainFriendlyName);
356             }
357             if (FxTrace.ShouldTraceWarningToTraceSource)
358             {
359                 string description = string.Format(Culture, ResourceManager.GetString("DiscoveryMessageWithNullMessageSequence", Culture), discoveryMessageName, messageId);
360                 TD.WriteTraceSource(9, description, payload);
361             }
362         }
363         
364         /// <summary>
365         /// Check if trace definition is enabled
366         /// Event description ID=4811, Level=Warning, Channel=debug
367         /// </summary>
368         internal static bool DiscoveryMessageWithNullRelatesToIsEnabled()
369         {
370             return (FxTrace.ShouldTraceWarning 
371                         && (FxTrace.ShouldTraceWarningToTraceSource || TD.IsEtwEventEnabled(10)));
372         }
373         
374         /// <summary>
375         /// Gets trace definition like: A {0} message with messageId='{1}' was dropped by the DiscoveryClient because the message header did not contain the required RelatesTo property.
376         /// Event description ID=4811, Level=Warning, Channel=debug
377         /// </summary>
378         /// <param name="eventTraceActivity">The event trace activity</param>
379         /// <param name="discoveryMessageName">Parameter 0 for event: A {0} message with messageId='{1}' was dropped by the DiscoveryClient because the message header did not contain the required RelatesTo property.</param>
380         /// <param name="messageId">Parameter 1 for event: A {0} message with messageId='{1}' was dropped by the DiscoveryClient because the message header did not contain the required RelatesTo property.</param>
381         internal static void DiscoveryMessageWithNullRelatesTo(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity, string discoveryMessageName, string messageId)
382         {
383             TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
384             if (TD.IsEtwEventEnabled(10))
385             {
386                 TD.WriteEtwEvent(10, eventTraceActivity, discoveryMessageName, messageId, payload.AppDomainFriendlyName);
387             }
388             if (FxTrace.ShouldTraceWarningToTraceSource)
389             {
390                 string description = string.Format(Culture, ResourceManager.GetString("DiscoveryMessageWithNullRelatesTo", Culture), discoveryMessageName, messageId);
391                 TD.WriteTraceSource(10, description, payload);
392             }
393         }
394         
395         /// <summary>
396         /// Check if trace definition is enabled
397         /// Event description ID=4812, Level=Warning, Channel=debug
398         /// </summary>
399         internal static bool DiscoveryMessageWithNullReplyToIsEnabled()
400         {
401             return (FxTrace.ShouldTraceWarning 
402                         && (FxTrace.ShouldTraceWarningToTraceSource || TD.IsEtwEventEnabled(11)));
403         }
404         
405         /// <summary>
406         /// Gets trace definition like: A discovery request message with messageId='{0}' was dropped because it did not have a ReplyTo address.
407         /// Event description ID=4812, Level=Warning, Channel=debug
408         /// </summary>
409         /// <param name="eventTraceActivity">The event trace activity</param>
410         /// <param name="messageId">Parameter 0 for event: A discovery request message with messageId='{0}' was dropped because it did not have a ReplyTo address.</param>
411         internal static void DiscoveryMessageWithNullReplyTo(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity, string messageId)
412         {
413             TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
414             if (TD.IsEtwEventEnabled(11))
415             {
416                 TD.WriteEtwEvent(11, eventTraceActivity, messageId, payload.AppDomainFriendlyName);
417             }
418             if (FxTrace.ShouldTraceWarningToTraceSource)
419             {
420                 string description = string.Format(Culture, ResourceManager.GetString("DiscoveryMessageWithNullReplyTo", Culture), messageId);
421                 TD.WriteTraceSource(11, description, payload);
422             }
423         }
424         
425         /// <summary>
426         /// Check if trace definition is enabled
427         /// Event description ID=4813, Level=Warning, Channel=debug
428         /// </summary>
429         internal static bool DuplicateDiscoveryMessageIsEnabled()
430         {
431             return (FxTrace.ShouldTraceWarning 
432                         && (FxTrace.ShouldTraceWarningToTraceSource || TD.IsEtwEventEnabled(12)));
433         }
434         
435         /// <summary>
436         /// Gets trace definition like: A {0} message with messageId='{1}' was dropped because it was a duplicate.
437         /// Event description ID=4813, Level=Warning, Channel=debug
438         /// </summary>
439         /// <param name="eventTraceActivity">The event trace activity</param>
440         /// <param name="messageType">Parameter 0 for event: A {0} message with messageId='{1}' was dropped because it was a duplicate.</param>
441         /// <param name="messageId">Parameter 1 for event: A {0} message with messageId='{1}' was dropped because it was a duplicate.</param>
442         internal static void DuplicateDiscoveryMessage(System.Runtime.Diagnostics.EventTraceActivity eventTraceActivity, string messageType, string messageId)
443         {
444             TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
445             if (TD.IsEtwEventEnabled(12))
446             {
447                 TD.WriteEtwEvent(12, eventTraceActivity, messageType, messageId, payload.AppDomainFriendlyName);
448             }
449             if (FxTrace.ShouldTraceWarningToTraceSource)
450             {
451                 string description = string.Format(Culture, ResourceManager.GetString("DuplicateDiscoveryMessage", Culture), messageType, messageId);
452                 TD.WriteTraceSource(12, description, payload);
453             }
454         }
455         
456         /// <summary>
457         /// Check if trace definition is enabled
458         /// Event description ID=4814, Level=Informational, Channel=debug
459         /// </summary>
460         internal static bool EndpointDiscoverabilityDisabledIsEnabled()
461         {
462             return (FxTrace.ShouldTraceInformation 
463                         && (FxTrace.ShouldTraceInformationToTraceSource || TD.IsEtwEventEnabled(13)));
464         }
465         
466         /// <summary>
467         /// Gets trace definition like: The discoverability of endpoint with EndpointAddress='{0}' and ListenUri='{1}' has been disabled.
468         /// Event description ID=4814, Level=Informational, Channel=debug
469         /// </summary>
470         /// <param name="endpointAddress">Parameter 0 for event: The discoverability of endpoint with EndpointAddress='{0}' and ListenUri='{1}' has been disabled.</param>
471         /// <param name="listenUri">Parameter 1 for event: The discoverability of endpoint with EndpointAddress='{0}' and ListenUri='{1}' has been disabled.</param>
472         internal static void EndpointDiscoverabilityDisabled(string endpointAddress, string listenUri)
473         {
474             TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
475             if (TD.IsEtwEventEnabled(13))
476             {
477                 TD.WriteEtwEvent(13, null, endpointAddress, listenUri, payload.AppDomainFriendlyName);
478             }
479             if (FxTrace.ShouldTraceInformationToTraceSource)
480             {
481                 string description = string.Format(Culture, ResourceManager.GetString("EndpointDiscoverabilityDisabled", Culture), endpointAddress, listenUri);
482                 TD.WriteTraceSource(13, description, payload);
483             }
484         }
485         
486         /// <summary>
487         /// Check if trace definition is enabled
488         /// Event description ID=4815, Level=Informational, Channel=debug
489         /// </summary>
490         internal static bool EndpointDiscoverabilityEnabledIsEnabled()
491         {
492             return (FxTrace.ShouldTraceInformation 
493                         && (FxTrace.ShouldTraceInformationToTraceSource || TD.IsEtwEventEnabled(14)));
494         }
495         
496         /// <summary>
497         /// Gets trace definition like: The discoverability of endpoint with EndpointAddress='{0}' and ListenUri='{1}' has been enabled.
498         /// Event description ID=4815, Level=Informational, Channel=debug
499         /// </summary>
500         /// <param name="endpointAddress">Parameter 0 for event: The discoverability of endpoint with EndpointAddress='{0}' and ListenUri='{1}' has been enabled.</param>
501         /// <param name="listenUri">Parameter 1 for event: The discoverability of endpoint with EndpointAddress='{0}' and ListenUri='{1}' has been enabled.</param>
502         internal static void EndpointDiscoverabilityEnabled(string endpointAddress, string listenUri)
503         {
504             TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
505             if (TD.IsEtwEventEnabled(14))
506             {
507                 TD.WriteEtwEvent(14, null, endpointAddress, listenUri, payload.AppDomainFriendlyName);
508             }
509             if (FxTrace.ShouldTraceInformationToTraceSource)
510             {
511                 string description = string.Format(Culture, ResourceManager.GetString("EndpointDiscoverabilityEnabled", Culture), endpointAddress, listenUri);
512                 TD.WriteTraceSource(14, description, payload);
513             }
514         }
515         
516         /// <summary>
517         /// Check if trace definition is enabled
518         /// Event description ID=4816, Level=Verbose, Channel=debug
519         /// </summary>
520         internal static bool FindInitiatedInDiscoveryClientChannelIsEnabled()
521         {
522             return (FxTrace.ShouldTraceVerbose 
523                         && (FxTrace.ShouldTraceVerboseToTraceSource || TD.IsEtwEventEnabled(15)));
524         }
525         
526         /// <summary>
527         /// Gets trace definition like: A Find operation was initiated in the DiscoveryClientChannel to discover endpoint(s).
528         /// Event description ID=4816, Level=Verbose, Channel=debug
529         /// </summary>
530         internal static void FindInitiatedInDiscoveryClientChannel()
531         {
532             TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
533             if (TD.IsEtwEventEnabled(15))
534             {
535                 TD.WriteEtwEvent(15, null, payload.AppDomainFriendlyName);
536             }
537             if (FxTrace.ShouldTraceVerboseToTraceSource)
538             {
539                 string description = string.Format(Culture, ResourceManager.GetString("FindInitiatedInDiscoveryClientChannel", Culture));
540                 TD.WriteTraceSource(15, description, payload);
541             }
542         }
543         
544         /// <summary>
545         /// Check if trace definition is enabled
546         /// Event description ID=4817, Level=Warning, Channel=debug
547         /// </summary>
548         internal static bool InnerChannelCreationFailedIsEnabled()
549         {
550             return (FxTrace.ShouldTraceWarning 
551                         && (FxTrace.ShouldTraceWarningToTraceSource || TD.IsEtwEventEnabled(16)));
552         }
553         
554         /// <summary>
555         /// Gets trace definition like: The DiscoveryClientChannel failed to create the channel with a discovered endpoint with EndpointAddress='{0}' and Via='{1}'. The DiscoveryClientChannel will now attempt to use the next available discovered endpoint.
556         /// Event description ID=4817, Level=Warning, Channel=debug
557         /// </summary>
558         /// <param name="endpointAddress">Parameter 0 for event: The DiscoveryClientChannel failed to create the channel with a discovered endpoint with EndpointAddress='{0}' and Via='{1}'. The DiscoveryClientChannel will now attempt to use the next available discovered endpoint.</param>
559         /// <param name="via">Parameter 1 for event: The DiscoveryClientChannel failed to create the channel with a discovered endpoint with EndpointAddress='{0}' and Via='{1}'. The DiscoveryClientChannel will now attempt to use the next available discovered endpoint.</param>
560         /// <param name="exception">Exception associated with the event</param>
561         internal static void InnerChannelCreationFailed(string endpointAddress, string via, System.Exception exception)
562         {
563             TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, exception);
564             if (TD.IsEtwEventEnabled(16))
565             {
566                 TD.WriteEtwEvent(16, null, endpointAddress, via, payload.SerializedException, payload.AppDomainFriendlyName);
567             }
568             if (FxTrace.ShouldTraceWarningToTraceSource)
569             {
570                 string description = string.Format(Culture, ResourceManager.GetString("InnerChannelCreationFailed", Culture), endpointAddress, via);
571                 TD.WriteTraceSource(16, description, payload);
572             }
573         }
574         
575         /// <summary>
576         /// Check if trace definition is enabled
577         /// Event description ID=4818, Level=Warning, Channel=debug
578         /// </summary>
579         internal static bool InnerChannelOpenFailedIsEnabled()
580         {
581             return (FxTrace.ShouldTraceWarning 
582                         && (FxTrace.ShouldTraceWarningToTraceSource || TD.IsEtwEventEnabled(17)));
583         }
584         
585         /// <summary>
586         /// Gets trace definition like: The DiscoveryClientChannel failed to open the channel with a discovered endpoint with EndpointAddress='{0}' and Via='{1}'. The DiscoveryClientChannel will now attempt to use the next available discovered endpoint.
587         /// Event description ID=4818, Level=Warning, Channel=debug
588         /// </summary>
589         /// <param name="endpointAddress">Parameter 0 for event: The DiscoveryClientChannel failed to open the channel with a discovered endpoint with EndpointAddress='{0}' and Via='{1}'. The DiscoveryClientChannel will now attempt to use the next available discovered endpoint.</param>
590         /// <param name="via">Parameter 1 for event: The DiscoveryClientChannel failed to open the channel with a discovered endpoint with EndpointAddress='{0}' and Via='{1}'. The DiscoveryClientChannel will now attempt to use the next available discovered endpoint.</param>
591         /// <param name="exception">Exception associated with the event</param>
592         internal static void InnerChannelOpenFailed(string endpointAddress, string via, System.Exception exception)
593         {
594             TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, exception);
595             if (TD.IsEtwEventEnabled(17))
596             {
597                 TD.WriteEtwEvent(17, null, endpointAddress, via, payload.SerializedException, payload.AppDomainFriendlyName);
598             }
599             if (FxTrace.ShouldTraceWarningToTraceSource)
600             {
601                 string description = string.Format(Culture, ResourceManager.GetString("InnerChannelOpenFailed", Culture), endpointAddress, via);
602                 TD.WriteTraceSource(17, description, payload);
603             }
604         }
605         
606         /// <summary>
607         /// Check if trace definition is enabled
608         /// Event description ID=4819, Level=Informational, Channel=debug
609         /// </summary>
610         internal static bool InnerChannelOpenSucceededIsEnabled()
611         {
612             return (FxTrace.ShouldTraceInformation 
613                         && (FxTrace.ShouldTraceInformationToTraceSource || TD.IsEtwEventEnabled(18)));
614         }
615         
616         /// <summary>
617         /// Gets trace definition like: The DiscoveryClientChannel successfully discovered an endpoint and opened the channel using it. The client is connected to a service using EndpointAddress='{0}' and Via='{1}'.
618         /// Event description ID=4819, Level=Informational, Channel=debug
619         /// </summary>
620         /// <param name="endpointAddress">Parameter 0 for event: The DiscoveryClientChannel successfully discovered an endpoint and opened the channel using it. The client is connected to a service using EndpointAddress='{0}' and Via='{1}'.</param>
621         /// <param name="via">Parameter 1 for event: The DiscoveryClientChannel successfully discovered an endpoint and opened the channel using it. The client is connected to a service using EndpointAddress='{0}' and Via='{1}'.</param>
622         internal static void InnerChannelOpenSucceeded(string endpointAddress, string via)
623         {
624             TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
625             if (TD.IsEtwEventEnabled(18))
626             {
627                 TD.WriteEtwEvent(18, null, endpointAddress, via, payload.AppDomainFriendlyName);
628             }
629             if (FxTrace.ShouldTraceInformationToTraceSource)
630             {
631                 string description = string.Format(Culture, ResourceManager.GetString("InnerChannelOpenSucceeded", Culture), endpointAddress, via);
632                 TD.WriteTraceSource(18, description, payload);
633             }
634         }
635         
636         /// <summary>
637         /// Check if trace definition is enabled
638         /// Event description ID=4820, Level=Informational, Channel=debug
639         /// </summary>
640         internal static bool SynchronizationContextResetIsEnabled()
641         {
642             return (FxTrace.ShouldTraceInformation 
643                         && (FxTrace.ShouldTraceInformationToTraceSource || TD.IsEtwEventEnabled(19)));
644         }
645         
646         /// <summary>
647         /// Gets trace definition like: The SynchronizationContext has been reset to its original value of {0} by DiscoveryClientChannel.
648         /// Event description ID=4820, Level=Informational, Channel=debug
649         /// </summary>
650         /// <param name="synchronizationContextType">Parameter 0 for event: The SynchronizationContext has been reset to its original value of {0} by DiscoveryClientChannel.</param>
651         internal static void SynchronizationContextReset(string synchronizationContextType)
652         {
653             TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
654             if (TD.IsEtwEventEnabled(19))
655             {
656                 TD.WriteEtwEvent(19, null, synchronizationContextType, payload.AppDomainFriendlyName);
657             }
658             if (FxTrace.ShouldTraceInformationToTraceSource)
659             {
660                 string description = string.Format(Culture, ResourceManager.GetString("SynchronizationContextReset", Culture), synchronizationContextType);
661                 TD.WriteTraceSource(19, description, payload);
662             }
663         }
664         
665         /// <summary>
666         /// Check if trace definition is enabled
667         /// Event description ID=4821, Level=Informational, Channel=debug
668         /// </summary>
669         internal static bool SynchronizationContextSetToNullIsEnabled()
670         {
671             return (FxTrace.ShouldTraceInformation 
672                         && (FxTrace.ShouldTraceInformationToTraceSource || TD.IsEtwEventEnabled(20)));
673         }
674         
675         /// <summary>
676         /// Gets trace definition like: The SynchronizationContext has been set to null by DiscoveryClientChannel before initiating the Find operation.
677         /// Event description ID=4821, Level=Informational, Channel=debug
678         /// </summary>
679         internal static void SynchronizationContextSetToNull()
680         {
681             TracePayload payload = FxTrace.Trace.GetSerializedPayload(null, null, null);
682             if (TD.IsEtwEventEnabled(20))
683             {
684                 TD.WriteEtwEvent(20, null, payload.AppDomainFriendlyName);
685             }
686             if (FxTrace.ShouldTraceInformationToTraceSource)
687             {
688                 string description = string.Format(Culture, ResourceManager.GetString("SynchronizationContextSetToNull", Culture));
689                 TD.WriteTraceSource(20, description, payload);
690             }
691         }
692         
693         /// <summary>
694         /// Creates the event descriptors array
695         /// </summary>
696         static void CreateEventDescriptors()
697         {
698             System.Runtime.Diagnostics.EventDescriptor[] descriptors = new System.Runtime.Diagnostics.EventDescriptor[] {
699                     new System.Runtime.Diagnostics.EventDescriptor(4801, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Warning, (byte)30, 0x9e1, 0x1000000000004000),
700                     new System.Runtime.Diagnostics.EventDescriptor(4802, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Informational, (byte)29, 0x9e1, 0x1000000000004000),
701                     new System.Runtime.Diagnostics.EventDescriptor(4803, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Informational, (byte)31, 0x9e1, 0x1000000000004000),
702                     new System.Runtime.Diagnostics.EventDescriptor(4804, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Informational, (byte)45, 0x9e3, 0x1000000000004000),
703                     new System.Runtime.Diagnostics.EventDescriptor(4805, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Warning, (byte)37, 0x9e3, 0x1000000000004000),
704                     new System.Runtime.Diagnostics.EventDescriptor(4806, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Warning, (byte)38, 0x9e3, 0x1000000000004000),
705                     new System.Runtime.Diagnostics.EventDescriptor(4807, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Warning, (byte)39, 0x9e3, 0x1000000000004000),
706                     new System.Runtime.Diagnostics.EventDescriptor(4808, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Warning, (byte)40, 0x9e3, 0x1000000000004000),
707                     new System.Runtime.Diagnostics.EventDescriptor(4809, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Warning, (byte)41, 0x9e3, 0x1000000000004000),
708                     new System.Runtime.Diagnostics.EventDescriptor(4810, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Warning, (byte)42, 0x9e3, 0x1000000000004000),
709                     new System.Runtime.Diagnostics.EventDescriptor(4811, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Warning, (byte)43, 0x9e3, 0x1000000000004000),
710                     new System.Runtime.Diagnostics.EventDescriptor(4812, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Warning, (byte)44, 0x9e3, 0x1000000000004000),
711                     new System.Runtime.Diagnostics.EventDescriptor(4813, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Warning, (byte)36, 0x9e3, 0x1000000000004000),
712                     new System.Runtime.Diagnostics.EventDescriptor(4814, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Informational, (byte)58, 0x9e6, 0x1000000000004000),
713                     new System.Runtime.Diagnostics.EventDescriptor(4815, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Informational, (byte)59, 0x9e6, 0x1000000000004000),
714                     new System.Runtime.Diagnostics.EventDescriptor(4816, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Verbose, (byte)33, 0x9e2, 0x1000000000004000),
715                     new System.Runtime.Diagnostics.EventDescriptor(4817, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Warning, (byte)32, 0x9e2, 0x1000000000004000),
716                     new System.Runtime.Diagnostics.EventDescriptor(4818, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Warning, (byte)34, 0x9e2, 0x1000000000004000),
717                     new System.Runtime.Diagnostics.EventDescriptor(4819, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Informational, (byte)35, 0x9e2, 0x1000000000004000),
718                     new System.Runtime.Diagnostics.EventDescriptor(4820, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Informational, (byte)46, 0x9e4, 0x1000000000004000),
719                     new System.Runtime.Diagnostics.EventDescriptor(4821, 0, (byte)TraceChannel.Debug, (byte)TraceEventLevel.Informational, (byte)47, 0x9e4, 0x1000000000004000)};
720             ushort[] e2eEvents = new ushort[] {
721                     4804,
722                     4805,
723                     4806,
724                     4807,
725                     4808,
726                     4809,
727                     4811,
728                     4812,
729                     4813};
730             FxTrace.UpdateEventDefinitions(descriptors, e2eEvents);
731             eventDescriptors = descriptors;
732         }
733         
734         /// <summary>
735         /// Ensures that the event descriptors array is initialized
736         /// </summary>
737         static void EnsureEventDescriptors()
738         {
739             if (eventDescriptorsCreated)
740             {
741                 return;
742             }
743             System.Threading.Monitor.Enter(syncLock);
744             try
745             {
746                 if (eventDescriptorsCreated)
747                 {
748                     return;
749                 }
750                 CreateEventDescriptors();
751                 eventDescriptorsCreated = true;
752             }
753             finally
754             {
755                 System.Threading.Monitor.Exit(syncLock);
756             }
757         }
758         
759         /// <summary>
760         /// Check if ETW tracing is enabled for the particular event
761         /// </summary>
762         /// <param name="eventIndex">The index of the event descriptor</param>
763         static bool IsEtwEventEnabled(int eventIndex)
764         {
765             if (FxTrace.Trace.IsEtwProviderEnabled)
766             {
767                 EnsureEventDescriptors();
768                 return FxTrace.IsEventEnabled(eventIndex);
769             }
770             return false;
771         }
772         
773         /// <summary>
774         /// Writes ETW trace event
775         ///</summary>
776         /// <param name="eventIndex">The index of the event descriptor</param>>
777         /// <param name="eventParam0">A parameter of the ETW event</param>>
778         /// <param name="eventParam1">A parameter of the ETW event</param>>
779         /// <param name="eventParam2">A parameter of the ETW event</param>>
780         static bool WriteEtwEvent(int eventIndex, System.Runtime.Diagnostics.EventTraceActivity eventParam0, string eventParam1, string eventParam2)
781         {
782             EnsureEventDescriptors();
783             return FxTrace.Trace.EtwProvider.WriteEvent(ref eventDescriptors[eventIndex], eventParam0, eventParam1, eventParam2);
784         }
785         
786         /// <summary>
787         /// Writes ETW trace event
788         ///</summary>
789         /// <param name="eventIndex">The index of the event descriptor</param>>
790         /// <param name="eventParam0">A parameter of the ETW event</param>>
791         /// <param name="eventParam1">A parameter of the ETW event</param>>
792         static bool WriteEtwEvent(int eventIndex, System.Runtime.Diagnostics.EventTraceActivity eventParam0, string eventParam1)
793         {
794             EnsureEventDescriptors();
795             return FxTrace.Trace.EtwProvider.WriteEvent(ref eventDescriptors[eventIndex], eventParam0, eventParam1);
796         }
797         
798         /// <summary>
799         /// Writes ETW trace event
800         ///</summary>
801         /// <param name="eventIndex">The index of the event descriptor</param>>
802         /// <param name="eventParam0">A parameter of the ETW event</param>>
803         /// <param name="eventParam1">A parameter of the ETW event</param>>
804         /// <param name="eventParam2">A parameter of the ETW event</param>>
805         /// <param name="eventParam3">A parameter of the ETW event</param>>
806         /// <param name="eventParam4">A parameter of the ETW event</param>>
807         static bool WriteEtwEvent(int eventIndex, System.Runtime.Diagnostics.EventTraceActivity eventParam0, string eventParam1, string eventParam2, string eventParam3, string eventParam4)
808         {
809             EnsureEventDescriptors();
810             return FxTrace.Trace.EtwProvider.WriteEvent(ref eventDescriptors[eventIndex], eventParam0, eventParam1, eventParam2, eventParam3, eventParam4);
811         }
812         
813         /// <summary>
814         /// Writes ETW trace event
815         ///</summary>
816         /// <param name="eventIndex">The index of the event descriptor</param>>
817         /// <param name="eventParam0">A parameter of the ETW event</param>>
818         /// <param name="eventParam1">A parameter of the ETW event</param>>
819         /// <param name="eventParam2">A parameter of the ETW event</param>>
820         /// <param name="eventParam3">A parameter of the ETW event</param>>
821         static bool WriteEtwEvent(int eventIndex, System.Runtime.Diagnostics.EventTraceActivity eventParam0, string eventParam1, string eventParam2, string eventParam3)
822         {
823             EnsureEventDescriptors();
824             return FxTrace.Trace.EtwProvider.WriteEvent(ref eventDescriptors[eventIndex], eventParam0, eventParam1, eventParam2, eventParam3);
825         }
826         
827         /// <summary>
828         /// Writes ETW trace event
829         ///</summary>
830         /// <param name="eventIndex">The index of the event descriptor</param>>
831         /// <param name="eventParam0">A parameter of the ETW event</param>>
832         /// <param name="eventParam1">A parameter of the ETW event</param>>
833         /// <param name="eventParam2">A parameter of the ETW event</param>>
834         /// <param name="eventParam3">A parameter of the ETW event</param>>
835         /// <param name="eventParam4">A parameter of the ETW event</param>>
836         /// <param name="eventParam5">A parameter of the ETW event</param>>
837         static bool WriteEtwEvent(int eventIndex, System.Runtime.Diagnostics.EventTraceActivity eventParam0, string eventParam1, string eventParam2, string eventParam3, string eventParam4, string eventParam5)
838         {
839             EnsureEventDescriptors();
840             return FxTrace.Trace.EtwProvider.WriteEvent(ref eventDescriptors[eventIndex], eventParam0, eventParam1, eventParam2, eventParam3, eventParam4, eventParam5);
841         }
842         
843         /// <summary>
844         /// write a trace source into the diagnostic trace
845         /// </summary>
846         /// <param name="eventIndex">The index of the event descriptor</param>
847         /// <param name="description">The description to write</param>
848         /// <param name="payload">The trace payload</param>
849         static void WriteTraceSource(int eventIndex, string description, TracePayload payload)
850         {
851             EnsureEventDescriptors();
852             FxTrace.Trace.WriteTraceSource(ref eventDescriptors[eventIndex], description, payload);
853         }
854     }
855 }
856