2005-11-09 Chris Toshok <toshok@ximian.com>
[mono.git] / mcs / class / System.Web / System.Web.Configuration_2.0 / TagPrefixInfo.cs
1 //
2 // System.Web.Configuration.TagPrefixInfo
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 #if NET_2_0
32
33 using System;
34 using System.ComponentModel;
35 using System.Configuration;
36 using System.Web.UI;
37 using System.Xml;
38
39 namespace System.Web.Configuration
40 {
41         public sealed class TagPrefixInfo : ConfigurationElement
42         {
43                 static ConfigurationPropertyCollection properties;
44                 static ConfigurationProperty tagPrefixProp;
45                 static ConfigurationProperty namespaceProp;
46                 static ConfigurationProperty assemblyProp;
47                 static ConfigurationProperty tagNameProp;
48                 static ConfigurationProperty sourceProp;
49
50                 static TagPrefixInfo ()
51                 {
52                         tagPrefixProp = new ConfigurationProperty ("tagPrefix", typeof (string), "/", ConfigurationPropertyOptions.IsRequired);
53                         namespaceProp = new ConfigurationProperty ("namespace", typeof (string));
54                         assemblyProp = new ConfigurationProperty ("assembly", typeof (string));
55                         tagNameProp = new ConfigurationProperty ("tagName", typeof (string));
56                         sourceProp = new ConfigurationProperty ("src", typeof (string));
57
58                         properties = new ConfigurationPropertyCollection ();
59                         properties.Add (tagPrefixProp);
60                         properties.Add (namespaceProp);
61                         properties.Add (assemblyProp);
62                         properties.Add (tagNameProp);
63                         properties.Add (sourceProp);
64                 }
65
66                 public TagPrefixInfo (string tagPrefix, string nameSpace, string assembly, string tagName, string source)
67                 {
68                         this.TagPrefix = tagPrefix;
69                         this.Namespace = nameSpace;
70                         this.Assembly = assembly;
71                         this.TagName = tagName;
72                         this.Source = source;
73                 }
74
75                 [MonoTODO]
76                 public override bool Equals (object prefix)
77                 {
78                         return base.Equals (prefix);
79                 }
80
81                 [MonoTODO]
82                 public override int GetHashCode ()
83                 {
84                         return base.GetHashCode ();
85                 }
86
87                 [ConfigurationProperty ("assembly")]
88                 public string Assembly {
89                         get { return (string) base[assemblyProp]; }
90                         set { base[assemblyProp] = value; }
91                 }
92
93 #if notyet
94                 [MonoTODO]
95                 protected override ConfigurationElementProperty ElementProperty {
96                         get { return base.ElementProperty; }
97                 }
98 #endif
99
100                 [ConfigurationProperty ("namespace")]
101                 public string Namespace {
102                         get { return (string) base[namespaceProp]; }
103                         set { base[namespaceProp] = value; }
104                 }
105
106                 [ConfigurationProperty ("src")]
107                 public string Source {
108                         get { return (string) base[sourceProp]; }
109                         set { base[sourceProp] = value; }
110                 }
111
112                 [ConfigurationProperty ("tagName")]
113                 public string TagName {
114                         get { return (string) base[tagNameProp]; }
115                         set { base[tagNameProp] = value; }
116                 }
117
118                 [StringValidator (MinLength = 1)]
119                 [ConfigurationProperty ("tagPrefix", DefaultValue = "/", Options = ConfigurationPropertyOptions.IsRequired)]
120                 public string TagPrefix {
121                         get { return (string) base[tagPrefixProp]; }
122                         set { base[tagPrefixProp] = value; }
123                 }
124
125                 protected override ConfigurationPropertyCollection Properties {
126                         get { return properties; }
127                 }
128         }
129 }
130
131 #endif