Files
mono/mcs/class/System.XML/System.Xml.Serialization/XmlElementAttribute.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
1.9 KiB
C#

//
// XmlElementAttribute.cs:
//
// Author:
// John Donagher ([email protected])
//
// (C) 2002 John Donagher
//
using System.Xml.Schema;
using System;
namespace System.Xml.Serialization
{
/// <summary>
/// Summary description for XmlElementAttribute.
/// </summary
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field
| AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple=true)]
public class XmlElementAttribute : Attribute
{
private string dataType;
private string elementName;
private XmlSchemaForm form;
private string ns;
private bool isNullable;
private Type type;
public XmlElementAttribute ()
{
}
public XmlElementAttribute (string elementName)
{
ElementName = elementName;
}
public XmlElementAttribute (Type type)
{
Type = type;
}
public XmlElementAttribute (string elementName, Type type)
{
ElementName = elementName;
Type = type;
}
public string DataType {
get {
return dataType;
}
set {
dataType = value;
}
}
public string ElementName {
get {
return elementName;
}
set {
elementName = value;
}
}
public XmlSchemaForm Form {
get {
return form;
}
set {
form = value;
}
}
public string Namespace {
get {
return ns;
}
set {
ns = value;
}
}
public bool IsNullable {
get {
return isNullable;
}
set {
isNullable = value;
}
}
public Type Type {
get {
return type;
}
set {
type = value;
}
}
internal bool InternalEquals (XmlElementAttribute other)
{
if (other == null) return false;
return (elementName == other.elementName &&
dataType == other.dataType &&
type == other.type &&
form == other.form &&
ns == other.ns &&
isNullable == other.isNullable);
}
}
}