2010-03-02 Jb Evain <jbevain@novell.com>
[mcs.git] / class / System.Web / System.Web.Configuration_2.0 / HostingEnvironmentSection.cs
blob4444f4a25e55250ee1eeade20d7e5c03a9463f9f
1 //
2 // System.Web.Configuration.HostingEnvironmentSection
3 //
4 // Authors:
5 // Chris Toshok (toshok@ximian.com)
6 //
7 // (c) Copyright 2005 Novell, Inc (http://www.novell.com)
8 //
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:
18 //
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 //
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.
31 using System;
32 using System.ComponentModel;
33 using System.Configuration;
35 #if NET_2_0
37 namespace System.Web.Configuration {
39 public sealed class HostingEnvironmentSection : ConfigurationSection
41 static ConfigurationProperty idleTimeoutProp;
42 static ConfigurationProperty shadowCopyBinAssembliesProp;
43 static ConfigurationProperty shutdownTimeoutProp;
44 static ConfigurationPropertyCollection properties;
46 static HostingEnvironmentSection ()
48 idleTimeoutProp = new ConfigurationProperty ("idleTimeout", typeof (TimeSpan), TimeSpan.MaxValue,
49 PropertyHelper.TimeSpanMinutesOrInfiniteConverter,
50 PropertyHelper.PositiveTimeSpanValidator,
51 ConfigurationPropertyOptions.None);
52 shadowCopyBinAssembliesProp = new ConfigurationProperty ("shadowCopyBinAssemblies", typeof (bool), true);
53 shutdownTimeoutProp = new ConfigurationProperty ("shutdownTimeout", typeof (TimeSpan), TimeSpan.FromSeconds (30),
54 PropertyHelper.TimeSpanSecondsConverter,
55 PropertyHelper.PositiveTimeSpanValidator,
56 ConfigurationPropertyOptions.None);
57 properties = new ConfigurationPropertyCollection ();
59 properties.Add (idleTimeoutProp);
60 properties.Add (shadowCopyBinAssembliesProp);
61 properties.Add (shutdownTimeoutProp);
65 [TypeConverter (typeof (TimeSpanMinutesOrInfiniteConverter))]
66 [TimeSpanValidator (MinValueString = "00:00:00", MaxValueString = "10675199.02:48:05.4775807")]
67 [ConfigurationProperty ("idleTimeout", DefaultValue = "10675199.02:48:05.4775807")]
68 public TimeSpan IdleTimeout {
69 get { return (TimeSpan) base [idleTimeoutProp];}
70 set { base[idleTimeoutProp] = value; }
73 [ConfigurationProperty ("shadowCopyBinAssemblies", DefaultValue = "True")]
74 public bool ShadowCopyBinAssemblies {
75 get { return (bool) base [shadowCopyBinAssembliesProp];}
76 set { base[shadowCopyBinAssembliesProp] = value; }
79 [TypeConverter (typeof (TimeSpanSecondsConverter))]
80 [TimeSpanValidator (MinValueString = "00:00:00", MaxValueString = "10675199.02:48:05.4775807")]
81 [ConfigurationProperty ("shutdownTimeout", DefaultValue = "00:00:30")]
82 public TimeSpan ShutdownTimeout {
83 get { return (TimeSpan) base [shutdownTimeoutProp];}
84 set { base[shutdownTimeoutProp] = value; }
87 protected override ConfigurationPropertyCollection Properties {
88 get { return properties; }
95 #endif