[Mono-dev] [PATCH]TraceEventType

joel reed joel.reed at ddiworld.com
Sun Jan 22 22:13:10 EST 2006


I'd like to implement System.Diagnostics.TraceSource if no one has already 
planned to do so. This is a 2.0 class.

To do so, I first needed the enumeration TraceEventType.

See:
http://msdn2.microsoft.com/en-us/library/system.diagnostics.traceeventtype.aspx

I've only submitted one bug fix previously to the mono project,
so I thought I'd post the patch for TraceEventType, in the hopes
that it would either be applied or else get needed feedback, and
also let the list know I'd like to do TraceSource.

Thanks!

jr
-------------- next part --------------
diff --git a/mcs/class/System/System.Diagnostics/TraceEventType.cs b/mcs/class/System/System.Diagnostics/TraceEventType.cs
new file mode 100644
index 0000000..4954743
--- /dev/null
+++ b/mcs/class/System/System.Diagnostics/TraceEventType.cs
@@ -0,0 +1,80 @@
+// TraceEventType.cs
+//
+// 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.
+//
+
+#if NET_2_0
+
+namespace System.Diagnostics {
+
+	/// <summary>
+	/// Type of event being traced
+	/// </summary>
+	public enum TraceEventType {
+
+		/// <summary>
+		/// Fatal, non-recoverable error
+		/// </summary>
+		CriticalFatal = 0,
+
+		/// <summary>
+		/// Recoverable error
+		/// </summary>
+		Error = 1,
+
+		/// <summary>
+		/// Informational event
+		/// </summary>
+		Information = 2,
+
+		/// <summary>
+		/// Operation Resumption
+		/// </summary>
+		Resume = 3,
+
+		/// <summary>
+		/// </summary>
+		Start = 4,
+
+		/// <summary>
+		/// </summary>
+		Stop = 5,
+
+		/// <summary>
+		/// </summary>
+		Suspend = 6,
+
+		/// <summary>
+		/// </summary>
+		Transfer = 7,
+
+		/// <summary>
+		/// </summary>
+		Verbose = 8,
+
+		/// <summary>
+		/// </summary>
+		Warning = 9
+
+	} // TraceEventType
+
+} // System.Diagnostics
+
+#endif
diff --git a/mcs/class/System/System.dll.sources b/mcs/class/System/System.dll.sources
index 2782d80..dc39513 100644
--- a/mcs/class/System/System.dll.sources
+++ b/mcs/class/System/System.dll.sources
@@ -450,6 +450,7 @@ System.Diagnostics/ThreadPriorityLevel.c
 System.Diagnostics/ThreadState.cs
 System.Diagnostics/ThreadWaitReason.cs
 System.Diagnostics/Trace.cs
+System.Diagnostics/TraceEventType.cs
 System.Diagnostics/TraceImpl.cs
 System.Diagnostics/TraceLevel.cs
 System.Diagnostics/TraceListenerCollection.cs


More information about the Mono-devel-list mailing list