Add #if CONFIGURATION_DEP and #if XML_DEP in Trace class and co.
[mono.git] / mcs / class / referencesource / System / compmod / system / diagnostics / TraceSection.cs
1 //------------------------------------------------------------------------------
2 // <copyright file="TraceSection.cs" company="Microsoft Corporation">
3 //     Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //------------------------------------------------------------------------------
6
7 #if CONFIGURATION_DEP
8 using System.Configuration;
9
10 namespace System.Diagnostics {
11     internal class TraceSection : ConfigurationElement {
12         private static readonly ConfigurationPropertyCollection _properties;
13         private static readonly ConfigurationProperty _propListeners        = new ConfigurationProperty("listeners", typeof(ListenerElementsCollection), new ListenerElementsCollection(), ConfigurationPropertyOptions.None);
14         private static readonly ConfigurationProperty _propAutoFlush        = new ConfigurationProperty("autoflush", typeof(bool), false, ConfigurationPropertyOptions.None);
15         private static readonly ConfigurationProperty _propIndentSize       = new ConfigurationProperty("indentsize", typeof(int), 4, ConfigurationPropertyOptions.None);
16         private static readonly ConfigurationProperty _propUseGlobalLock    = new ConfigurationProperty("useGlobalLock", typeof(bool), true, ConfigurationPropertyOptions.None);
17
18         static TraceSection() {
19             _properties = new ConfigurationPropertyCollection();
20             _properties.Add(_propListeners);
21             _properties.Add(_propAutoFlush);
22             _properties.Add(_propIndentSize);
23             _properties.Add(_propUseGlobalLock);
24         }
25
26         [ConfigurationProperty( "autoflush", DefaultValue=false )]
27         public bool AutoFlush {
28             get { 
29                 return (bool) this[_propAutoFlush]; 
30             }
31         }
32
33         [ConfigurationProperty( "indentsize", DefaultValue=4 )]
34         public int IndentSize {
35             get { 
36                 return (int) this[_propIndentSize]; 
37             }
38         }
39
40         [ConfigurationProperty( "listeners" )]
41         public ListenerElementsCollection Listeners {
42             get { 
43                 return (ListenerElementsCollection) this[_propListeners]; 
44             }
45         }
46
47         [ConfigurationProperty( "useGlobalLock", DefaultValue = true)]
48         public bool UseGlobalLock {
49             get { 
50                 return (bool) this[_propUseGlobalLock]; 
51             }
52         }
53
54         protected override ConfigurationPropertyCollection Properties {
55             get {
56                 return _properties;
57             }
58         }
59     }
60 }
61
62 #endif