2 // System.Web.Configuration.HostingEnvironmentSection
5 // Chris Toshok (toshok@ximian.com)
7 // (c) Copyright 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.
32 using System
.ComponentModel
;
33 using System
.Configuration
;
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; }