Files
mono/mcs/class/System.XML/System.Xml.Serialization/XmlSerializerImplementation.cs
T
Sebastien Pouliot 4925054bb0 Make some S.X.S types compatible with the SL API (for SDK)
* XmlAnyElementAttributes.cs:
* XmlArrayItemAttributes.cs:
* XmlElementAttributes.cs:
	Under Silverlight API this implement IList only (does not
inherit from CollectionBase).

* XmlCustomFormatter.cs:
* XmlSerializationWriterInterpreter.cs:
	Use a Convert.ChangeType override that exists in SL API

* XmlReflectionImporter.cs: Provide an alternative for (missing in SL)
Enum.GetNames and select available (in SL) overloads for parsing and
formatting for enums

* XmlSerializationReader.cs: Fix ToEnum API to use IDictionary (in SL)
instead of Hashtable (even if the SL4 docs still states the later)

* XmlSerializationReaderInterpreter.cs:
* XmlTypeMapping.cs:
	Use the default (identical to nonPublic being false) when using
	Activator.CreateInstance under SL

* XmlSerializationWriter.cs: Internally use a Queue<T> instead a a Queue
(not available in SL). Also Namespaces (ArrayList) is replaced by
XmlNamespaces (IList) in SL API.

* XmlSerializer.cs: Do not use environment variables in MOONLIGHT (like
the rest of MOBILE). Use Encoding.UTF8 instead of ENcoding.Default since
the later does not exist in SL.

* XmlSerializerImplementation.cs: SL version use IDictionary instead of
Hashtable for properties.

* XmlSerializerNamespaces.cs: Internally use a generic Dictionary
* instead
of a ListDictionary (which is not available in SL)
2011-05-06 08:40:41 -04:00

82 lines
2.3 KiB
C#

//
// XmlSerializerImplementation.cs
//
// Author:
// Atsushi Enomoto <[email protected]>
//
// Copyright (C) 2006 Novell, Inc.
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Collections;
namespace System.Xml.Serialization
{
#if NET_2_0
public
#else
internal
#endif
abstract class XmlSerializerImplementation
{
public virtual XmlSerializationReader Reader {
get { throw new NotSupportedException (); }
}
#if MOONLIGHT
public virtual IDictionary ReadMethods {
get { throw new NotSupportedException (); }
}
public virtual IDictionary TypedSerializers {
get { throw new NotSupportedException (); }
}
public virtual IDictionary WriteMethods {
get { throw new NotSupportedException (); }
}
#else
public virtual Hashtable ReadMethods {
get { throw new NotSupportedException (); }
}
public virtual Hashtable TypedSerializers {
get { throw new NotSupportedException (); }
}
public virtual Hashtable WriteMethods {
get { throw new NotSupportedException (); }
}
#endif
public virtual XmlSerializationWriter Writer {
get { throw new NotSupportedException (); }
}
public virtual bool CanSerialize (Type type)
{
throw new NotSupportedException ();
}
public virtual XmlSerializer GetSerializer (Type type)
{
throw new NotSupportedException ();
}
}
}