2 // System.Web.Configuration.TraceSection
5 // Chris Toshok (toshok@ximian.com)
7 // (C) 2005 Novell, Inc (http://www.novell.com)
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33 using System.Configuration;
37 namespace System.Web.Configuration {
39 public sealed class TraceSection : ConfigurationSection
41 static ConfigurationProperty enabledProp;
42 static ConfigurationProperty localOnlyProp;
43 static ConfigurationProperty mostRecentProp;
44 static ConfigurationProperty pageOutputProp;
45 static ConfigurationProperty requestLimitProp;
46 static ConfigurationProperty traceModeProp;
47 static ConfigurationProperty writeToDiagnosticsTraceProp;
48 static ConfigurationPropertyCollection properties;
50 static TraceSection ()
52 enabledProp = new ConfigurationProperty ("enabled", typeof (bool), false);
53 localOnlyProp = new ConfigurationProperty ("localOnly", typeof (bool), true);
54 mostRecentProp = new ConfigurationProperty ("mostRecent", typeof (bool), false);
55 pageOutputProp = new ConfigurationProperty ("pageOutput", typeof (bool), false);
56 requestLimitProp = new ConfigurationProperty ("requestLimit", typeof (int), 10);
57 traceModeProp = new ConfigurationProperty ("traceMode", typeof (TraceDisplayMode), TraceDisplayMode.SortByTime);
58 writeToDiagnosticsTraceProp = new ConfigurationProperty ("writeToDiagnosticsTrace", typeof (bool), false);
59 properties = new ConfigurationPropertyCollection ();
61 properties.Add (enabledProp);
62 properties.Add (localOnlyProp);
63 properties.Add (mostRecentProp);
64 properties.Add (pageOutputProp);
65 properties.Add (requestLimitProp);
66 properties.Add (traceModeProp);
67 properties.Add (writeToDiagnosticsTraceProp);
70 [ConfigurationProperty ("enabled", DefaultValue = "False")]
72 get { return (bool) base [enabledProp];}
73 set { base[enabledProp] = value; }
76 [ConfigurationProperty ("localOnly", DefaultValue = "True")]
77 public bool LocalOnly {
78 get { return (bool) base [localOnlyProp];}
79 set { base[localOnlyProp] = value; }
82 [ConfigurationProperty ("mostRecent", DefaultValue = "False")]
83 public bool MostRecent {
84 get { return (bool) base [mostRecentProp];}
85 set { base[mostRecentProp] = value; }
88 [ConfigurationProperty ("pageOutput", DefaultValue = "False")]
89 public bool PageOutput {
90 get { return (bool) base [pageOutputProp];}
91 set { base[pageOutputProp] = value; }
94 [IntegerValidator (MinValue = 0, MaxValue = Int32.MaxValue)]
95 [ConfigurationProperty ("requestLimit", DefaultValue = "10")]
96 public int RequestLimit {
97 get { return (int) base [requestLimitProp];}
98 set { base[requestLimitProp] = value; }
101 [ConfigurationProperty ("traceMode", DefaultValue = "SortByTime")]
102 public TraceDisplayMode TraceMode {
103 get { return (TraceDisplayMode) base [traceModeProp];}
104 set { base[traceModeProp] = value; }
107 [ConfigurationProperty ("writeToDiagnosticsTrace", DefaultValue = "False")]
108 public bool WriteToDiagnosticsTrace {
109 get { return (bool) base [writeToDiagnosticsTraceProp];}
110 set { base[writeToDiagnosticsTraceProp] = value; }
113 protected override ConfigurationPropertyCollection Properties {
114 get { return properties; }