2 // XmlTypeMapElementInfo.cs:
5 // Lluis Sanchez Gual (lluis@ximian.com)
7 // (C) 2002, 2003 Ximian, Inc. http://www.ximian.com
11 using System.Xml.Schema;
12 using System.Collections;
14 namespace System.Xml.Serialization
17 /// Summary description for XmlTypeMapElementInfo.
19 internal class XmlTypeMapElementInfo
23 string _namespace = "";
25 XmlTypeMapMember _member;
28 int _nestingLevel; // Only for array items
29 XmlTypeMapping _mappedType;
31 bool _wrappedElement = true;
33 public XmlTypeMapElementInfo (XmlTypeMapMember member, TypeData type)
39 public TypeData TypeData
42 set { _type = value; }
45 public string ChoiceValue
47 get { return _choiceValue; }
48 set { _choiceValue = value; }
51 public string ElementName
53 get { return _elementName; }
54 set { _elementName = value; }
57 public string Namespace
59 get { return _namespace; }
60 set { _namespace = value; }
63 public string DataType
65 get { return _dataType; }
66 set { _dataType = value; }
69 public string DataTypeNamespace
73 if (_mappedType == null) return XmlSchema.Namespace;
74 else return _mappedType.Namespace;
78 public XmlSchemaForm Form
81 set { _form = value; }
84 public XmlTypeMapping MappedType
86 get { return _mappedType; }
87 set { _mappedType = value; }
90 public bool IsNullable
92 get { return _isNullable; }
93 set { _isNullable = value; }
96 internal bool IsPrimitive
98 get { return _mappedType == null; }
101 public XmlTypeMapMember Member
103 get { return _member; }
104 set { _member = value; }
107 public int NestingLevel
109 get { return _nestingLevel; }
110 set { _nestingLevel = value; }
113 public bool MultiReferenceType
117 if (_mappedType != null) return _mappedType.MultiReferenceType;
122 public bool WrappedElement
124 get { return _wrappedElement; }
125 set { _wrappedElement = value; }
128 public override bool Equals (object other)
130 XmlTypeMapElementInfo oinfo = (XmlTypeMapElementInfo)other;
131 if (_elementName != oinfo._elementName) return false;
132 if (_dataType != oinfo._dataType) return false;
133 if (_namespace != oinfo._namespace) return false;
134 if (_form != oinfo._form) return false;
135 if (_choiceValue != oinfo._choiceValue) return false;
136 if (_type.Type != oinfo._type.Type) return false;
137 if (_isNullable != oinfo._isNullable) return false;
141 public override int GetHashCode ()
143 return base.GetHashCode ();
147 class XmlTypeMapElementInfoList: ArrayList