--- /dev/null
+//
+// EventListener.cs
+//
+// Authors:
+// Frederik Carlier <frederik.carlier@quamotion.mobi>
+//
+// Copyright (C) 2015 Quamotion (http://quamotion.mobi)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.Collections.Generic;
+
+namespace System.Diagnostics.Tracing
+{
+ public abstract class EventListener : IDisposable
+ {
+ protected EventListener ()
+ {
+ }
+
+ public static int EventSourceIndex(EventSource eventSource)
+ {
+ return 0;
+ }
+
+ public void EnableEvents (EventSource eventSource, EventLevel level)
+ {
+ }
+
+ public void EnableEvents (EventSource eventSource, EventLevel level, EventKeywords matchAnyKeyword)
+ {
+ }
+
+ public void EnableEvents (EventSource eventSource, EventLevel level, EventKeywords matchAnyKeyword, IDictionary<string, string> arguments)
+ {
+ }
+
+ public void DisableEvents (EventSource eventSource)
+ {
+ }
+
+ protected internal virtual void OnEventSourceCreated (EventSource eventSource)
+ {
+ }
+
+ protected internal abstract void OnEventWritten (EventWrittenEventArgs eventData);
+
+ public virtual void Dispose()
+ {
+ }
+ }
+}
+
//
// Authors:
// Marek Safar <marek.safar@gmail.com>
+// Frederik Carlier <frederik.carlier@quamotion.mobi>
//
// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com)
+// Copyrithg (C) 2015 Quamotion (http://quamotion.mobi)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
{
}
+#if NET_4_6
public void Write<T> (string eventName, T data)
{
}
public void Write<T> (string eventName, ref EventSourceOptions options, ref Guid activityId, ref Guid relatedActivityId, ref T data)
{
}
+#endif
protected virtual void Dispose (bool disposing)
{
protected void WriteEvent (int eventId)
{
+ WriteEvent (eventId, new object[] { } );
}
protected void WriteEvent (int eventId, byte[] arg1)
{
+ WriteEvent (eventId, new object[] { arg1 } );
}
protected void WriteEvent (int eventId, int arg1)
{
+ WriteEvent (eventId, new object[] { arg1 } );
}
protected void WriteEvent (int eventId, string arg1)
{
+ WriteEvent (eventId, new object[] { arg1 } );
}
protected void WriteEvent (int eventId, int arg1, int arg2)
{
+ WriteEvent (eventId, new object[] { arg1, arg2 } );
}
protected void WriteEvent (int eventId, int arg1, int arg2, int arg3)
{
+ WriteEvent (eventId, new object[] { arg1, arg2, arg3 } );
}
protected void WriteEvent (int eventId, int arg1, string arg2)
{
+ WriteEvent (eventId, new object[] { arg1, arg2 } );
}
protected void WriteEvent (int eventId, long arg1)
{
+ WriteEvent (eventId, new object[] { arg1 } );
}
protected void WriteEvent (int eventId, long arg1, byte[] arg2)
{
+ WriteEvent (eventId, new object[] { arg1, arg2 } );
}
protected void WriteEvent (int eventId, long arg1, long arg2)
{
+ WriteEvent (eventId, new object[] { arg1, arg2 } );
}
protected void WriteEvent (int eventId, long arg1, long arg2, long arg3)
{
+ WriteEvent (eventId, new object[] { arg1, arg2, arg3 } );
}
protected void WriteEvent (int eventId, long arg1, string arg2)
{
+ WriteEvent (eventId, new object[] { arg1, arg2 } );
}
protected void WriteEvent (int eventId, params object[] args)
protected void WriteEvent (int eventId, string arg1, int arg2)
{
+ WriteEvent (eventId, new object[] { arg1, arg2 } );
}
protected void WriteEvent (int eventId, string arg1, int arg2, int arg3)
{
+ WriteEvent (eventId, new object[] { arg1, arg2, arg3 } );
}
protected void WriteEvent (int eventId, string arg1, long arg2)
{
+ WriteEvent (eventId, new object[] { arg1, arg2 } );
}
protected void WriteEvent (int eventId, string arg1, string arg2)
{
+ WriteEvent (eventId, new object[] { arg1, arg2 } );
}
protected void WriteEvent (int eventId, string arg1, string arg2, string arg3)
{
+ WriteEvent (eventId, new object[] { arg1, arg2, arg3 } );
}
}
}
--- /dev/null
+//
+// EventWrittenEventArgs.cs
+//
+// Authors:
+// Frederik Carlier <frederik.carlier@quamotion.mobi>
+//
+// Copyright (C) 2015 Quamotion (http://quamotion.mobi)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+
+namespace System.Diagnostics.Tracing
+{
+ public class EventWrittenEventArgs : EventArgs
+ {
+ internal EventWrittenEventArgs (EventSource eventSource)
+ {
+ this.EventSource = eventSource;
+ }
+
+ public Guid ActivityId
+ {
+ get { return EventSource.CurrentThreadActivityId; }
+ }
+
+ public EventChannel Channel
+ {
+ get { return EventChannel.None; }
+ }
+
+ public int EventId
+ {
+ get;
+ internal set;
+ }
+
+ public string EventName
+ {
+ get;
+ internal set;
+ }
+
+ public EventSource EventSource
+ {
+ get;
+ private set;
+ }
+
+ public EventKeywords Keywords
+ {
+ get { return EventKeywords.None; }
+ }
+
+ public EventLevel Level
+ {
+ get { return EventLevel.LogAlways; }
+ }
+
+ public string Message
+ {
+ get;
+ internal set;
+ }
+
+ public EventOpcode Opcode
+ {
+ get { return EventOpcode.Info; }
+ }
+
+ public ReadOnlyCollection<object> Payload
+ {
+ get;
+ internal set;
+ }
+
+ public ReadOnlyCollection<string> PayloadNames
+ {
+ get;
+ internal set;
+ }
+
+ public Guid RelatedActivityId
+ {
+ get;
+ internal set;
+ }
+
+ public EventTags Tags
+ {
+ get { return EventTags.None; }
+ }
+
+ public EventTask Task
+ {
+ get { return EventTask.None; }
+ }
+
+ public byte Version
+ {
+ get { return 0; }
+ }
+ }
+}
+
System.Diagnostics.Tracing/EventSourceAttribute.cs
System.Diagnostics.Tracing/EventSourceSettings.cs
System.Diagnostics.Tracing/EventCommandEventArgs.cs
+System.Diagnostics.Tracing/EventListener.cs
+System.Diagnostics.Tracing/EventWrittenEventArgs.cs
System.Diagnostics.Tracing/NonEventAttribute.cs
System.Diagnostics.SymbolStore/ISymbolBinder.cs
System.Diagnostics.SymbolStore/ISymbolBinder1.cs