Files
mono/mcs/class/System.XML/System.Xml.Serialization/XmlReflectionMember.cs
T
Lluis Sanchez 95d2d48bb3 * SerializationCodeGenerator.cs: Added support for generation of readers
and writers for several maps in a single class. Added support for
	  XmlMemberMapping. Fixed generation of serializers that use encoded format.
	* SoapAttributeAttribute.cs, SoapAttributeOverrides.cs, SoapAttributes.cs,
	  SoapElementAttribute.cs, SoapEnumAttribute.cs, SoapTypeAttribute.cs,
	  XmlAnyElementAttribute.cs, XmlAnyElementAttributes.cs, XmlArrayAttribute.cs,
	  XmlArrayItemAttribute.cs, XmlArrayItemAttributes.cs, XmlAttributeAttribute.cs,
	  XmlAttributeOverrides.cs, XmlChoiceIdentifierAttribute.cs, XmlRootAttribute.cs,
	  XmlElementAttribute.cs, XmlElementAttributes.cs, XmlEnumAttribute.cs,
	  XmlReflectionMember.cs, XmlTextAttribute.cs, XmlTypeAttribute.cs:
	  Added InternalEquals method.
	* XmlAttributes.cs: Removed a lot of unused code. Added InternalEquals method.
	* SoapReflectionImporter.cs: Set SerializationSource to generated maps.
	* XmlCustomFormatter.cs: Fixed little bug.
	* XmlMapping.cs: Added Source property. This a global identifier of the map.
	* XmlReflectionImporter.cs: Set SerializationSource to generated maps.
	* XmlSchemaImporter.cs: Set the correct value for IsNillable when importing
	  mapping members.
	* XmlSerializationReaderInterpreter.cs, XmlSerializationWriter.cs: Minor fixes.
	* XmlSerializationWriterInterpreter.cs: WriteObject and WriteEnum were not
	  correctly used.
	* XmlSerializer.cs: Added support for generation of serializers.

svn path=/trunk/mcs/; revision=23392
2004-02-24 12:03:28 +00:00

109 lines
2.4 KiB
C#

//
// System.Xml.Serialization.XmlReflectionMember
//
// Author:
// Tim Coleman ([email protected])
//
// Copyright (C) Tim Coleman, 2002
//
namespace System.Xml.Serialization {
public class XmlReflectionMember {
#region Fields
bool isReturnValue;
string memberName;
Type memberType;
bool overrideIsNullable;
SoapAttributes soapAttributes;
XmlAttributes xmlAttributes;
#endregion
#region Constructors
public XmlReflectionMember ()
{
}
internal XmlReflectionMember (string name, Type type, XmlAttributes attributes)
{
memberName = name;
memberType = type;
xmlAttributes = attributes;
}
internal XmlReflectionMember (string name, Type type, SoapAttributes attributes)
{
memberName = name;
memberType = type;
soapAttributes = attributes;
}
#endregion // Constructors
#region Properties
public bool IsReturnValue {
get { return isReturnValue; }
set { isReturnValue = value; }
}
public string MemberName {
get { return memberName; }
set { memberName = value; }
}
public Type MemberType {
get { return memberType; }
set { memberType = value; }
}
public bool OverrideIsNullable {
get { return overrideIsNullable; }
set { overrideIsNullable = value; }
}
public SoapAttributes SoapAttributes {
get {
if (soapAttributes == null) soapAttributes = new SoapAttributes();
return soapAttributes;
}
set { soapAttributes = value; }
}
public XmlAttributes XmlAttributes {
get {
if (xmlAttributes == null) xmlAttributes = new XmlAttributes();
return xmlAttributes;
}
set { xmlAttributes = value; }
}
internal bool InternalEquals (XmlReflectionMember other)
{
if (other == null) return false;
if (isReturnValue != other.isReturnValue) return false;
if (memberName != other.memberName) return false;
if (memberType != other.memberType) return false;
if (overrideIsNullable != other.overrideIsNullable) return false;
if (soapAttributes == null) {
if (other.soapAttributes != null) return false; }
else
if (!soapAttributes.InternalEquals (other.soapAttributes)) return false;
if (xmlAttributes == null) {
if (other.xmlAttributes != null) return false; }
else
if (!xmlAttributes.InternalEquals (other.xmlAttributes)) return false;
return true;
}
#endregion // Properties
}
}