diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2007-05-17 21:10:25 +0400 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2007-05-17 21:10:25 +0400 |
commit | 720ddca1bdf093300bcbe87bb719c81026bad836 (patch) | |
tree | adb26ba0489785b9ff52f53d72b796e0a5ff130d /mcs/class/System/System.Diagnostics/TraceSwitch.cs | |
parent | f32fe807d9103ed38fdab1b72c822adcfee99130 (diff) |
2007-05-17 Atsushi Enomoto <atsushi@ximian.com>
* TraceOptions.cs : new enum.
* TraceListener.cs : support TraceOutputOptions. Fixed missing
NET_2_0 condition in TARGET_JVM section.
* TraceSwitch.cs, BooleanSwitch.cs :
Added missing constructors and OnValueChanged().
* Trace.cs, TraceImpl.cs :
Added CorrelationManager and UseGlobalLock.
* TraceEventCache.cs : initialize property values at construction.
* Switch.cs : added XmlIgnore on Attributes.
* SwitchesTest.cs : added tests for BooleanSwitch Value.
* TraceListenerTest.cs : added test for TraceOutputOptions.
* System.dll.sources : added TraceOptions.cs.
svn path=/trunk/mcs/; revision=77581
Diffstat (limited to 'mcs/class/System/System.Diagnostics/TraceSwitch.cs')
-rw-r--r-- | mcs/class/System/System.Diagnostics/TraceSwitch.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/mcs/class/System/System.Diagnostics/TraceSwitch.cs b/mcs/class/System/System.Diagnostics/TraceSwitch.cs index b159b75a084..9f3ccef2158 100644 --- a/mcs/class/System/System.Diagnostics/TraceSwitch.cs +++ b/mcs/class/System/System.Diagnostics/TraceSwitch.cs @@ -34,6 +34,9 @@ namespace System.Diagnostics { +#if NET_2_0 + [SwitchLevel (typeof (TraceLevel))] +#endif public class TraceSwitch : Switch { public TraceSwitch(string displayName, string description) @@ -41,6 +44,14 @@ namespace System.Diagnostics { } +#if NET_2_0 + public TraceSwitch(string displayName, string description, string defaultSwitchValue) + : base(displayName, description) + { + Value = defaultSwitchValue; + } +#endif + public TraceLevel Level { get {return (TraceLevel) SwitchSetting;} set { @@ -76,6 +87,13 @@ namespace System.Diagnostics if (SwitchSetting < 0) SwitchSetting = (int) TraceLevel.Off; } + +#if NET_2_0 + protected override void OnValueChanged () + { + Level = (TraceLevel) Enum.Parse (typeof (TraceLevel), Value); + } +#endif } } |