* SerializationCodeGenerator.cs: Added support for generation of readers
[mono.git] / mcs / class / System.XML / System.Xml.Serialization / XmlAttributeAttribute.cs
1 //
2 // XmlAttributeAttribute.cs: 
3 //
4 // Author:
5 //   John Donagher (john@webmeta.com)
6 //
7 // (C) 2002 John Donagher
8 //
9
10 using System.Xml.Schema;\r
11 using System;\r
12 \r
13 namespace System.Xml.Serialization\r
14 {\r
15         /// <summary>\r
16         /// Summary description for XmlAttributeAttribute.\r
17         /// </summary>\r
18         [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field\r
19                  | AttributeTargets.Parameter | AttributeTargets.ReturnValue)]\r
20         public class XmlAttributeAttribute : Attribute\r
21         {\r
22                 private string attributeName;\r
23                 private string dataType;\r
24                 private Type type;\r
25                 private XmlSchemaForm form;\r
26                 private string ns;\r
27 \r
28                 public XmlAttributeAttribute ()\r
29                 {\r
30                 }\r
31 \r
32                 public XmlAttributeAttribute (string attributeName)\r
33                 {\r
34                         AttributeName = attributeName;\r
35                 }\r
36                 \r
37                 public XmlAttributeAttribute (Type type)\r
38                 {\r
39                         Type = type;\r
40                 }\r
41 \r
42                 public XmlAttributeAttribute (string attributeName, Type type)\r
43                 {\r
44                         AttributeName = attributeName;\r
45                         Type = type;\r
46                 }\r
47 \r
48                 public string AttributeName {\r
49                         get {
50                                 return attributeName;
51                         }\r
52                         set {
53                                 attributeName = value;
54                         }\r
55                 }\r
56                 public string DataType {\r
57                         get {
58                                 return dataType;
59                         }\r
60                         set {
61                                 dataType = value;
62                         }\r
63                 }\r
64                 public XmlSchemaForm Form {\r
65                         get {
66                                 return form;
67                         }\r
68                         set {
69                                 form = value;
70                         }\r
71                 }\r
72                 public string Namespace {\r
73                         get {
74                                 return ns;
75                         }\r
76                         set {
77                                 ns = value;
78                         }\r
79                 }\r
80 \r
81                 public Type Type\r
82                 {\r
83                         get \r
84                         {
85                                 return type;
86                         }\r
87                         set \r
88                         {
89                                 type = value;
90                         }\r
91                 }\r
92                 \r
93                 internal bool InternalEquals (XmlAttributeAttribute other)\r
94                 {\r
95                         if (other == null) return false;\r
96                         \r
97                         return (attributeName == other.attributeName &&\r
98                                         dataType == other.dataType &&\r
99                                         type == other.type &&\r
100                                         form == other.form &&\r
101                                         ns == other.ns);\r
102                 }\r
103         }\r
104 }\r