Add System.Diagnostics.Switch/etc. to the MOBILE profile.
authorJonathan Pryor <jonpryor@vt.edu>
Mon, 29 Apr 2013 18:31:57 +0000 (14:31 -0400)
committerJonathan Pryor <jonpryor@vt.edu>
Mon, 29 Apr 2013 18:38:53 +0000 (14:38 -0400)
Followup to:

http://forums.xamarin.com/discussion/comment/11823/#Comment_11823

These are Switches with a labotomy: the MOBILE profile does not
support System.Configuration.dll, so there is no support for
.exe.config files or
System.Diagnostics.DiagnosticsConfigurationHandler.

Consequently these Switches are largely a compatibility/portability
aid: they DO NOT have the full functionality that the desktop
profile affords. Specifically, there is no way to provide an XML
config file that contains the Switch values to use. If you need to set
the Switch values, this MUST be done manually, e.g. through a Switch
constructor's `defaultSwitchValue` parameter or through a property,
e.g. for SourceSwitch:

http://msdn.microsoft.com/en-us/library/w65awck1.aspx
http://msdn.microsoft.com/en-us/library/system.diagnostics.sourceswitch.level.aspx

mcs/class/System/System.Diagnostics/Switch.cs
mcs/class/System/System.Diagnostics/Trace.cs
mcs/class/System/System.Diagnostics/TraceImpl.cs
mcs/class/System/mobile_System.dll.sources

index 14540ba084dacd1ea600839c702c781ce5f3b5f2..216cde7fa24ed4a667d4090421e33527c12bd08f 100644 (file)
@@ -141,6 +141,7 @@ namespace System.Diagnostics
 
                private void GetConfigFileSetting ()
                {
+#if !MOBILE
                        IDictionary d = (IDictionary) DiagnosticsConfiguration.Settings ["switches"];
                        
                        // Load up the specified switch
@@ -154,6 +155,7 @@ namespace System.Diagnostics
                                        return;
                                }
                        }
+#endif  // !MOBILE
 
                        if (defaultSwitchValue != null) {
                                value = defaultSwitchValue;
index b18197a6bf63a1c2c74f946cb51994f8a84e6591..d4bdca0b664af2f3bd4065754035f086ffc97e0d 100644 (file)
@@ -66,11 +66,9 @@ namespace System.Diagnostics {
                        get {return TraceImpl.Listeners;}
                }
 
-#if !MOBILE
                public static CorrelationManager CorrelationManager {
                        get { return TraceImpl.CorrelationManager; }
                }
-#endif
 
                public static bool UseGlobalLock {
                        get { return TraceImpl.UseGlobalLock; }
index 83ed38408f62d70a71a45b8de0597bf58b207887..55a8362a5519e2a7ff067515377eccdee5a9b27a 100644 (file)
@@ -163,7 +163,6 @@ namespace System.Diagnostics {
                }
 
                static bool use_global_lock;
-#if !MOBILE
                static CorrelationManager correlation_manager = new CorrelationManager ();
 
                public static CorrelationManager CorrelationManager {
@@ -172,7 +171,6 @@ namespace System.Diagnostics {
                                return correlation_manager;
                        }
                }
-#endif
 
                [MonoLimitation ("the property exists but it does nothing.")]
                public static bool UseGlobalLock {
index d832ee1e7109ab6410dcdb2456a672988ba376e1..8b5c746266977ce59eb19e3323925218f655d790 100644 (file)
@@ -196,6 +196,8 @@ System.ComponentModel/UInt64Converter.cs
 System.ComponentModel/WeakObjectWrapper.cs
 System.ComponentModel/WeakObjectWrapperComparer.cs
 System.ComponentModel/Win32Exception.cs
+System.Diagnostics/BooleanSwitch.cs
+System.Diagnostics/CorrelationManager.cs
 System.Diagnostics/DataReceivedEventArgs.cs
 System.Diagnostics/DataReceivedEventHandler.cs
 System.Diagnostics/Debug.cs
@@ -210,15 +212,23 @@ System.Diagnostics/ProcessStartInfo.cs
 System.Diagnostics/ProcessThread.cs
 System.Diagnostics/ProcessThreadCollection.cs
 System.Diagnostics/ProcessWindowStyle.cs
+System.Diagnostics/SourceLevels.cs
+System.Diagnostics/SourceSwitch.cs
 System.Diagnostics/Stopwatch.cs
+System.Diagnostics/Switch.cs
+System.Diagnostics/SwitchAttribute.cs
+System.Diagnostics/SwitchLevelAttribute.cs
+System.Diagnostics/ThreadPriorityLevel.cs
+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/TraceListener.cs
 System.Diagnostics/TraceListenerCollection.cs
 System.Diagnostics/TraceOptions.cs
-System.Diagnostics/ThreadPriorityLevel.cs
-System.Diagnostics/ThreadState.cs
-System.Diagnostics/ThreadWaitReason.cs
+System.Diagnostics/TraceSwitch.cs
 System.IO.Compression/CompressionLevel.cs
 System.IO.Compression/CompressionMode.cs
 System.IO.Compression/DeflateStream.cs