[Cleanup] Removed TARGET_JVM
[mono.git] / mcs / class / System.Web / Test / mainsoft / NunitWeb / NunitWeb / CustomSection.cs
1 #if NET_2_0
2
3 using System;
4 using System.Configuration;
5
6 namespace MonoTests.SystemWeb.Framework
7 {
8     public class CustomSection : ConfigurationSection
9     {
10         [ConfigurationProperty ("sections", IsRequired = true)]
11         public CustomSubSectionCollection AreaSections {
12             get {
13                 return (CustomSubSectionCollection) base["sections"];
14             }
15             set {
16                 base["sections"] = value;
17             }
18         }
19     }
20
21     public class CustomSubSectionCollection : ConfigurationElementCollection
22     {
23         protected override ConfigurationElement CreateNewElement () {
24             return new CustomTagCollection ();
25         }
26
27         protected override object GetElementKey (ConfigurationElement element) {
28             return (element as CustomTagCollection).Area;
29         }
30     }
31
32     public class CustomTagCollection : ConfigurationElementCollection
33     {
34         protected override ConfigurationElement CreateNewElement () {
35             return new CustomTagElement ();
36         }
37
38         protected override object GetElementKey (ConfigurationElement element) {
39             return ((CustomTagElement) element).Name;
40         }
41
42         [ConfigurationProperty ("area", DefaultValue = "UndefinedArea", IsKey = true, IsRequired = true)]
43         public string Area {
44             get {
45                 return (string) base["area"];
46             }
47         }
48     }
49
50     public class CustomTagElement : ConfigurationElement
51     {
52         [ConfigurationProperty ("name", DefaultValue = "CustomName", IsKey = true, IsRequired = true)]
53         public string Name {
54             get {
55                 return (string) base["name"];
56             }
57         }
58     }
59 }
60
61 #endif