Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@ -0,0 +1,31 @@
2010-03-08 Atsushi Enomoto <atsushi@ximian.com>
* TypeElementCollection.cs : more corcompare fixes.
2010-03-04 Atsushi Enomoto <atsushi@ximian.com>
* TypeElement.cs, DeclaredTypeElement.cs,
ParameterElementCollection.cs, DataContractSerializerSection.cs,
ParameterElement.cs :
Looks like MSDN pages are quite incorrect. updated to match what
status page tells.
2010-03-03 Atsushi Enomoto <atsushi@ximian.com>
* DataContractSerializerSection.cs : new.
* XmlFormatterSection.cs : remove.
* DeclaredTypeElementCollection.cs
TypeElement.cs
DeclaredTypeElement.cs
SerializationSectionGroup.cs
ParameterElementCollection.cs
TypeElementCollection.cs
ParameterElement.cs : implement.
2005-10-03 Atsushi Enomoto <atsushi@ximian.com>
* DeclaredTypeElementCollection.cs, TypeElement.cs,
DeclaredTypeElement.cs, SerializationSectionGroup.cs,
ParameterElementCollection.cs, TypeElementCollection.cs,
XmlFormatterSection.cs, ParameterElement.cs : new files.

View File

@ -0,0 +1,64 @@
//
// DataContractSerializerSection.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2010 Novell, Inc. http://www.novell.com
//
// 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.
//
#if NET_2_0
using System;
using System.Configuration;
namespace System.Runtime.Serialization.Configuration
{
public sealed class DataContractSerializerSection : ConfigurationSection
{
// Static Fields
static ConfigurationPropertyCollection properties;
static ConfigurationProperty declared_types;
static DataContractSerializerSection ()
{
properties = new ConfigurationPropertyCollection ();
declared_types = new ConfigurationProperty ("declaredTypes",
typeof (DeclaredTypeElementCollection), null, null, null,
ConfigurationPropertyOptions.None);
properties.Add (declared_types);
}
public DataContractSerializerSection ()
{
}
[ConfigurationPropertyAttribute ("declaredTypes", DefaultValue = null)]
public DeclaredTypeElementCollection DeclaredTypes {
get { return (DeclaredTypeElementCollection) base [declared_types]; }
}
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
}
}
#endif

View File

@ -0,0 +1,87 @@
//
// DeclaredTypeElement.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2005,2010 Novell, Inc. http://www.novell.com
//
// 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.
//
#if NET_2_0
using System;
using System.Configuration;
namespace System.Runtime.Serialization.Configuration
{
[MonoTODO]
public sealed class DeclaredTypeElement : ConfigurationElement
{
// Static Fields
static ConfigurationPropertyCollection properties;
static ConfigurationProperty known_types;
static ConfigurationProperty type;
static DeclaredTypeElement ()
{
properties = new ConfigurationPropertyCollection ();
known_types = new ConfigurationProperty ("",
typeof (TypeElementCollection), null, null, null,
ConfigurationPropertyOptions.IsDefaultCollection);
type = new ConfigurationProperty ("type",
typeof (string), "", null, null,
ConfigurationPropertyOptions.None);
properties.Add (known_types);
properties.Add (type);
}
public DeclaredTypeElement ()
{
}
public DeclaredTypeElement (string typeName)
{
Type = typeName;
}
[ConfigurationProperty ("", DefaultValue = null, Options = ConfigurationPropertyOptions.IsDefaultCollection)]
public TypeElementCollection KnownTypes {
get { return (TypeElementCollection) base [known_types]; }
}
[ConfigurationProperty ("type", DefaultValue = "", Options = ConfigurationPropertyOptions.IsKey)]
public string Type {
get { return (string) base [type]; }
set { base [type] = value; }
}
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
protected override void PostDeserialize ()
{
// what to do here?
base.PostDeserialize ();
}
}
}
#endif

View File

@ -0,0 +1,104 @@
//
// DeclaredTypeElementCollection.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2005 Novell, Inc. http://www.novell.com
//
// 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.
//
#if NET_2_0
using System;
using System.Configuration;
namespace System.Runtime.Serialization.Configuration
{
[ConfigurationCollection (typeof (DeclaredTypeElement))]
public sealed class DeclaredTypeElementCollection : ConfigurationElementCollection
{
public DeclaredTypeElementCollection ()
{
}
public DeclaredTypeElement this [int index] {
get { return (DeclaredTypeElement) BaseGet (index); }
set {
RemoveAt (index);
Add (value);
}
}
public new DeclaredTypeElement this [string typeName] {
get { return (DeclaredTypeElement) BaseGet (typeName); }
set {
Remove (typeName);
Add (value);
}
}
public void Add (DeclaredTypeElement element)
{
BaseAdd (element);
}
public void Clear ()
{
BaseClear ();
}
public bool Contains (string typeName)
{
return BaseGet (typeName) != null;
}
public int IndexOf (DeclaredTypeElement element)
{
return BaseIndexOf (element);
}
public void Remove (DeclaredTypeElement element)
{
Remove ((string) GetElementKey (element));
}
public void Remove (string typeName)
{
BaseRemove (typeName);
}
public void RemoveAt (int index)
{
BaseRemoveAt (index);
}
protected override ConfigurationElement CreateNewElement ()
{
return new DeclaredTypeElement ();
}
protected override Object GetElementKey (
ConfigurationElement element)
{
return ((DeclaredTypeElement) element).Type;
}
}
}
#endif

View File

@ -0,0 +1,111 @@
//
// ParameterElement.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2005,2010 Novell, Inc. http://www.novell.com
//
// 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.
//
#if NET_2_0
using System;
using System.Configuration;
using System.Xml;
namespace System.Runtime.Serialization.Configuration
{
public sealed class ParameterElement : ConfigurationElement
{
// Static Fields
static ConfigurationPropertyCollection properties;
static ConfigurationProperty index;
static ConfigurationProperty parameters;
static ConfigurationProperty type;
static ParameterElement ()
{
properties = new ConfigurationPropertyCollection ();
index = new ConfigurationProperty ("index",
typeof (int), "", null, null,
ConfigurationPropertyOptions.None);
parameters = new ConfigurationProperty ("",
typeof (ParameterElementCollection), null, null, null,
ConfigurationPropertyOptions.IsDefaultCollection);
type = new ConfigurationProperty ("type",
typeof (string), "", null, null,
ConfigurationPropertyOptions.None);
properties.Add (index);
properties.Add (parameters);
properties.Add (type);
}
public ParameterElement ()
{
}
public ParameterElement (int index)
{
Index = index;
}
public ParameterElement (string typeName)
{
Type = typeName;
}
[IntegerValidator (MinValue = 0)]
[ConfigurationProperty ("index", DefaultValue = 0)]
public int Index {
get { return (int) base [index]; }
set { base [index] = value; }
}
[ConfigurationProperty ("", DefaultValue = null, Options = ConfigurationPropertyOptions.IsDefaultCollection)]
public ParameterElementCollection Parameters {
get { return (ParameterElementCollection) base [parameters]; }
}
[StringValidator (MinLength = 0)]
[ConfigurationProperty ("type", DefaultValue = "")]
public string Type {
get { return (string) base [type]; }
set { base [type] = value; }
}
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
protected override void PreSerialize (XmlWriter writer)
{
// what to do here?
base.PreSerialize (writer);
}
protected override void PostDeserialize ()
{
// what to do here?
base.PostDeserialize ();
}
}
}
#endif

View File

@ -0,0 +1,100 @@
//
// ParameterElementCollection.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2005,2010 Novell, Inc. http://www.novell.com
//
// 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.
//
#if NET_2_0
using System;
using System.Configuration;
namespace System.Runtime.Serialization.Configuration
{
[ConfigurationCollection (typeof (ParameterElement), AddItemName = "parameter", CollectionType = ConfigurationElementCollectionType.BasicMap)]
public sealed class ParameterElementCollection : ConfigurationElementCollection
{
public ParameterElementCollection ()
{
}
public override ConfigurationElementCollectionType CollectionType {
get { return ConfigurationElementCollectionType.BasicMap; }
}
// FIXME: not very sure, just had a look at http://msdn.microsoft.com/en-us/library/ms731806.aspx
protected override string ElementName {
get { return String.Empty; }
}
public ParameterElement this [int index] {
get { return (ParameterElement) BaseGet (index); }
set {
BaseRemoveAt (index);
Add (value);
}
}
public void Add (ParameterElement element)
{
BaseAdd (element);
}
public void Clear ()
{
BaseClear ();
}
public bool Contains (string typeName)
{
return BaseGet (typeName) != null;
}
public int IndexOf (ParameterElement element)
{
return BaseIndexOf (element);
}
public void Remove (ParameterElement element)
{
BaseRemove ((string) GetElementKey (element));
}
public void RemoveAt (int index)
{
BaseRemoveAt (index);
}
protected override ConfigurationElement CreateNewElement ()
{
return new ParameterElement ();
}
protected override object GetElementKey (
ConfigurationElement element)
{
return ((ParameterElement) element).Type;
}
}
}
#endif

View File

@ -0,0 +1,55 @@
//
// SerializationSectionGroup.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2005,2010 Novell, Inc. http://www.novell.com
//
// 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.
//
#if NET_2_0
using System;
using System.Configuration;
using ConfigurationType = System.Configuration.Configuration;
namespace System.Runtime.Serialization.Configuration
{
public sealed class SerializationSectionGroup : ConfigurationSectionGroup
{
public static SerializationSectionGroup GetSectionGroup (ConfigurationType config)
{
var ret = (SerializationSectionGroup) config.GetSectionGroup ("system.runtime.serialization");
if (ret == null)
throw new SystemException ("Internal configuration error: section 'system.runtime.serialization' was not found.");
return ret;
}
public SerializationSectionGroup ()
{
}
public DataContractSerializerSection DataContractSerializer {
get { return (DataContractSerializerSection) Sections ["dataContractSerializer"]; }
}
}
}
#endif

View File

@ -0,0 +1,97 @@
//
// TypeElement.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2005,2010 Novell, Inc. http://www.novell.com
//
// 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.
//
#if NET_2_0
using System;
using System.Configuration;
namespace System.Runtime.Serialization.Configuration
{
public sealed class TypeElement : ConfigurationElement
{
// Static Fields
static ConfigurationPropertyCollection properties;
static ConfigurationProperty index;
static ConfigurationProperty parameters;
static ConfigurationProperty type;
static TypeElement ()
{
properties = new ConfigurationPropertyCollection ();
index = new ConfigurationProperty ("index",
typeof (int), "", null, null,
ConfigurationPropertyOptions.None);
parameters = new ConfigurationProperty ("",
typeof (ParameterElementCollection), null, null, null,
ConfigurationPropertyOptions.IsDefaultCollection);
type = new ConfigurationProperty ("type",
typeof (string), "", null, null,
ConfigurationPropertyOptions.None);
properties.Add (index);
properties.Add (parameters);
properties.Add (type);
}
public TypeElement ()
{
}
public TypeElement (string typeName)
{
}
[ConfigurationProperty ("index", DefaultValue = 0)]
[IntegerValidator (MinValue = 0)]
public int Index {
get { return (int) base [index]; }
set { base [index] = value; }
}
[ConfigurationProperty ("", DefaultValue = null, Options = ConfigurationPropertyOptions.IsDefaultCollection)]
public ParameterElementCollection Parameters {
get { return (ParameterElementCollection) base [parameters]; }
}
[ConfigurationProperty ("type", DefaultValue = "")]
[StringValidator (MinLength = 0)]
public string Type {
get { return (string) base [type]; }
set { base [type] = value; }
}
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
protected override void Reset (ConfigurationElement parentElement)
{
base.Reset (parentElement);
}
}
}
#endif

View File

@ -0,0 +1,95 @@
//
// TypeElementCollection.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2005 Novell, Inc. http://www.novell.com
//
// 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.
//
#if NET_2_0
using System;
using System.Configuration;
namespace System.Runtime.Serialization.Configuration
{
[ConfigurationCollection (typeof (TypeElement), CollectionType = ConfigurationElementCollectionType.BasicMap)]
public sealed class TypeElementCollection : ConfigurationElementCollection
{
public TypeElementCollection ()
{
}
public override ConfigurationElementCollectionType CollectionType {
get { return ConfigurationElementCollectionType.BasicMap; }
}
// It is undocumented.
protected override string ElementName {
get { return "knownType"; }
}
public TypeElement this [int index] {
get { return (TypeElement) BaseGet (index); }
set {
BaseRemoveAt (index);
Add (value);
}
}
public void Add (TypeElement element)
{
BaseAdd (element);
}
public void Clear ()
{
BaseClear ();
}
public int IndexOf (TypeElement element)
{
return BaseIndexOf (element);
}
public void Remove (TypeElement element)
{
BaseRemove ((string) GetElementKey (element));
}
public void RemoveAt (int index)
{
BaseRemoveAt (index);
}
protected override ConfigurationElement CreateNewElement ()
{
return new TypeElement ();
}
protected override Object GetElementKey (
ConfigurationElement element)
{
return ((TypeElement) element).Type;
}
}
}
#endif