2007-03-06 Adar Wesley <adarw@mainsoft.com>
[mono.git] / mcs / class / System.Web / System.Web.Configuration_2.0 / RoleManagerSection.cs
1 //
2 // System.Web.Configuration.RoleManagerSection
3 //
4 // Authors:
5 //      Chris Toshok (toshok@ximian.com)
6 //
7 // (C) 2005 Novell, Inc (http://www.novell.com)
8 //
9
10 //
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.
29 //
30
31 using System;
32 using System.ComponentModel;
33 using System.Configuration;
34 using System.Web.Security;
35
36 #if NET_2_0
37
38 namespace System.Web.Configuration {
39
40         public sealed class RoleManagerSection : ConfigurationSection
41         {
42                 [ConfigurationProperty ("cacheRolesInCookie", DefaultValue = false)]
43                 public bool CacheRolesInCookie {
44                         get { return (bool) base ["cacheRolesInCookie"]; }
45                         set { base ["cacheRolesInCookie"] = value; }
46                 }
47
48                 [TypeConverter (typeof (WhiteSpaceTrimStringConverter))]
49                 [StringValidator (MinLength = 1)]
50                 [ConfigurationProperty ("cookieName", DefaultValue = ".ASPXROLES")]
51                 public string CookieName {
52                         get { return (string) base ["cookieName"]; }
53                         set { base ["cookieName"] = value; }
54                 }
55
56                 [TypeConverter (typeof (WhiteSpaceTrimStringConverter))]
57                 [StringValidator (MinLength = 1)]
58                 [ConfigurationProperty ("cookiePath", DefaultValue = "/")]
59                 public string CookiePath {
60                         get { return (string) base ["cookiePath"]; }
61                         set { base ["cookiePath"] = value; }
62                 }
63
64                 [ConfigurationProperty ("cookieProtection", DefaultValue = "All")]
65                 public CookieProtection CookieProtection {
66                         get { return (CookieProtection) base ["cookieProtection"]; }
67                         set { base ["cookieProtection"] = value; }
68                 }
69
70                 [ConfigurationProperty ("cookieRequireSSL", DefaultValue = false)]
71                 public bool CookieRequireSSL {
72                         get { return (bool) base ["cookieRequireSSL"]; }
73                         set { base ["cookieRequireSSL"] = value; }
74                 }
75
76                 [ConfigurationProperty ("cookieSlidingExpiration", DefaultValue = true)]
77                 public bool CookieSlidingExpiration {
78                         get { return (bool) base ["cookieSlidingExpiration"]; }
79                         set { base ["cookieSlidingExpiration"] = value; }
80                 }
81
82                 [TypeConverter (typeof (TimeSpanMinutesOrInfiniteConverter))]
83                 [PositiveTimeSpanValidator]
84                 [ConfigurationProperty ("cookieTimeout", DefaultValue = "30")]
85                 public TimeSpan CookieTimeout {
86                         get { return (TimeSpan) base ["cookieTimeout"]; }
87                         set { base ["cookieTimeout"] = value; }
88                 }
89
90                 [ConfigurationProperty ("createPersistentCookie", DefaultValue = false)]
91                 public bool CreatePersistentCookie {
92                         get { return (bool) base ["createPersistentCookie"]; }
93                         set { base ["createPersistentCookie"] = value; }
94                 }
95
96                 [TypeConverter (typeof (WhiteSpaceTrimStringConverter))]
97                 [StringValidator (MinLength = 1)]
98                 [ConfigurationProperty ("defaultProvider", DefaultValue = "AspNetSqlRoleProvider")]
99                 public string DefaultProvider {
100                         get { return (string) base ["defaultProvider"]; }
101                         set { base ["defaultProvider"] = value; }
102                 }
103
104                 [ConfigurationProperty ("domain")]
105                 public string Domain {
106                         get { return (string) base ["domain"]; }
107                         set { base ["domain"] = value; }
108                 }
109
110                 [ConfigurationProperty ("enabled", DefaultValue = false)]
111                 public bool Enabled {
112                         get { return (bool) base ["enabled"]; }
113                         set { base ["enabled"] = value; }
114                 }
115
116                 [ConfigurationProperty ("maxCachedResults", DefaultValue = 25)]
117                 public int MaxCachedResults {
118                         get { return (int) base ["maxCachedResults"]; }
119                         set { base ["maxCachedResults"] = value; }
120                 }
121
122                 [ConfigurationProperty ("providers")]
123                 public ProviderSettingsCollection Providers {
124                         get { return (ProviderSettingsCollection) base ["providers"]; }
125                 }
126         }
127 }
128
129 #endif