mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-18 03:51:19 -10:00
* XmlAttributesTests.cs, XmlReflectionImporterTests.cs, XmlSerializationWriterTests.cs, XmlSerializerTests.cs: Simplified namespace hierarchy. * XmlSerializerTestClasses.cs: Added more test classes. svn path=/trunk/mcs/; revision=23956
89 lines
1.5 KiB
C#
89 lines
1.5 KiB
C#
//
|
|
// System.Xml.XmlSerializerTestClasses
|
|
//
|
|
// Author:
|
|
// Erik LeBel <[email protected]>
|
|
//
|
|
// (C) 2003 Erik LeBel
|
|
//
|
|
// Classes to use in the testing of the XmlSerializer
|
|
//
|
|
|
|
using System;
|
|
using System.Collections;
|
|
using System.Xml.Serialization;
|
|
|
|
namespace MonoTests.System.Xml.TestClasses
|
|
{
|
|
public enum SimpleEnumeration { FIRST, SECOND };
|
|
|
|
public class SimpleClass
|
|
{
|
|
public string something = null;
|
|
}
|
|
|
|
public class StringCollection : CollectionBase
|
|
{
|
|
public void Add (String parameter)
|
|
{
|
|
List.Insert (Count, parameter);
|
|
}
|
|
|
|
public String this [int index]
|
|
{
|
|
get
|
|
{
|
|
if (index < 0 || index > Count)
|
|
throw new ArgumentOutOfRangeException ();
|
|
|
|
return (String) List [index];
|
|
}
|
|
set { List [index] = value; }
|
|
}
|
|
}
|
|
|
|
public class StringCollectionContainer
|
|
{
|
|
StringCollection messages = new StringCollection();
|
|
|
|
public StringCollection Messages
|
|
{
|
|
get { return messages; }
|
|
}
|
|
}
|
|
|
|
public class ArrayContainer
|
|
{
|
|
public object [] items = null;
|
|
}
|
|
|
|
public class ClassArrayContainer
|
|
{
|
|
public SimpleClass [] items = null;
|
|
}
|
|
|
|
[XmlRoot("simple")]
|
|
public class SimpleClassWithXmlAttributes
|
|
{
|
|
[XmlAttribute("member")]
|
|
public string something = null;
|
|
}
|
|
|
|
[XmlRoot("field")]
|
|
public class Field
|
|
{
|
|
[XmlAttribute("modifiers")]
|
|
public MapModifiers Modifiers;
|
|
}
|
|
|
|
[Flags]
|
|
public enum MapModifiers
|
|
{
|
|
[XmlEnum("public")]
|
|
Public = 0,
|
|
[XmlEnum("protected")]
|
|
Protected = 1,
|
|
}
|
|
|
|
}
|