mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-19 01:31:17 -10:00
the 2001 one when reading the xsi type. * MapCodeGenerator.cs: Take into account that the root namespace and element name may have changed from one export to another of the same type. In this case the class attributes need to be regenerated. * SoapCodeExporter.cs, XmlCodeExporter.cs: Take the enum name from XmlType, not ElementName. Idem for namespace. * XmlReflectionImporter.cs: Set nullable property of XmlTypeMapping. * XmlRootAttribute.cs: Default value for nullable is true. * XmlSchemaImporter.cs: The root name for a class may change in some scenarios (for example, when the type is initially exported as part of another type and later exported as a root type). * XmlSerializationReader.cs: In GetXsiType(), if the type attribute is not found using the standard namespace, try getting the type using the 2000/10 and 1999 namespaces. * XmlTypeMapping.cs: Added IsNullable property. Updated SetRoot method. svn path=/trunk/mcs/; revision=28711
84 lines
1.4 KiB
C#
84 lines
1.4 KiB
C#
//
|
|
// XmlRootAttribute.cs:
|
|
//
|
|
// Author:
|
|
// John Donagher ([email protected])
|
|
//
|
|
// (C) 2002 John Donagher
|
|
//
|
|
|
|
using System;
|
|
|
|
namespace System.Xml.Serialization
|
|
{
|
|
/// <summary>
|
|
/// Summary description for XmlRootAttribute.
|
|
/// </summary>
|
|
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct |
|
|
AttributeTargets.Enum | AttributeTargets.Interface |
|
|
AttributeTargets.ReturnValue)]
|
|
public class XmlRootAttribute : Attribute
|
|
{
|
|
private string dataType;
|
|
private string elementName;
|
|
private bool isNullable = true;
|
|
private string ns;
|
|
|
|
public XmlRootAttribute ()
|
|
{
|
|
|
|
}
|
|
public XmlRootAttribute (string elementName)
|
|
{
|
|
ElementName = elementName;
|
|
}
|
|
|
|
public string DataType
|
|
{
|
|
get {
|
|
return dataType;
|
|
}
|
|
set {
|
|
dataType = value;
|
|
}
|
|
}
|
|
public string ElementName
|
|
{
|
|
get {
|
|
return elementName;
|
|
}
|
|
set {
|
|
elementName = value;
|
|
}
|
|
}
|
|
public bool IsNullable
|
|
{
|
|
get {
|
|
return isNullable;
|
|
}
|
|
set {
|
|
isNullable = value;
|
|
}
|
|
}
|
|
public string Namespace
|
|
{
|
|
get {
|
|
return ns;
|
|
}
|
|
set {
|
|
ns = value;
|
|
}
|
|
}
|
|
|
|
internal void AddKeyHash (System.Text.StringBuilder sb)
|
|
{
|
|
sb.Append ("XRA ");
|
|
KeyHelper.AddField (sb, 1, ns);
|
|
KeyHelper.AddField (sb, 2, elementName);
|
|
KeyHelper.AddField (sb, 3, dataType);
|
|
KeyHelper.AddField (sb, 4, isNullable);
|
|
sb.Append ('|');
|
|
}
|
|
}
|
|
}
|