Merge pull request #4045 from lambdageek/bug-47867
[mono.git] / mcs / class / System.Runtime.Serialization / ReferenceSources / DiagnosticUtility.cs
1 using System.Diagnostics;
2
3 namespace System.Runtime.Serialization {
4
5         internal static class DiagnosticUtility {
6                 internal static bool ShouldTraceError = true;
7                 internal static readonly bool ShouldTraceWarning = false;
8                 internal static readonly bool ShouldTraceInformation = false;
9                 internal static bool ShouldTraceVerbose = true;
10
11                 internal static class DiagnosticTrace {
12                         internal static void TraceEvent (params object [] args)
13                         {
14                         }
15                         
16                 }
17                 
18                 internal static class ExceptionUtility {
19                         internal static Exception ThrowHelperError (Exception e)
20                         {
21                                 return ThrowHelper (e, TraceEventType.Error);
22                         }
23
24                         internal static Exception ThrowHelperCallback (string msg, Exception e)
25                         {
26                                 return new CallbackException (msg, e);
27                         }
28
29                         internal static Exception ThrowHelperCallback (Exception e)
30                         {
31                                 return new CallbackException ("Callback exception", e);
32                         }
33
34                         internal static Exception ThrowHelper (Exception e, TraceEventType type)
35                         {
36                                 return e;
37                         }
38
39                         internal static Exception ThrowHelperArgument (string arg)
40                         {
41                                 return new ArgumentException (arg);
42                         }
43
44                         internal static Exception ThrowHelperArgument (string arg, string message)
45                         {
46                                 return new ArgumentException (message, arg);
47                         }
48
49                         internal static Exception ThrowHelperArgumentNull (string arg)
50                         {
51                                 return new ArgumentNullException (arg);
52                         }
53
54                         internal static Exception ThrowHelperFatal (string msg, Exception e)
55                         {
56                                 return new FatalException (msg, e);
57                         }
58                 }
59         }
60 }
61