You've already forked linux-packaging-mono
Imported Upstream version 4.2.0.179
Former-commit-id: 4610231f55806d2a05ed69e5ff3faa7336cc1479
This commit is contained in:
committed by
Jo Shields
parent
aa7da660d6
commit
c042cd0c52
@ -1,63 +0,0 @@
|
||||
//
|
||||
// System.Web.Services.Configuration.DiagnosticsElement
|
||||
//
|
||||
// Authors:
|
||||
// Chris Toshok (toshok@ximian.com)
|
||||
//
|
||||
// (C) 2006 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.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Configuration;
|
||||
|
||||
|
||||
namespace System.Web.Services.Configuration {
|
||||
|
||||
public sealed class DiagnosticsElement : ConfigurationElement
|
||||
{
|
||||
static ConfigurationProperty suppressReturningExceptionsProp;
|
||||
static ConfigurationPropertyCollection properties;
|
||||
|
||||
static DiagnosticsElement ()
|
||||
{
|
||||
suppressReturningExceptionsProp = new ConfigurationProperty ("suppressReturningExceptions", typeof (bool), false);
|
||||
properties = new ConfigurationPropertyCollection ();
|
||||
|
||||
properties.Add (suppressReturningExceptionsProp);
|
||||
}
|
||||
|
||||
[ConfigurationProperty ("suppressReturningExceptions", DefaultValue = "False")]
|
||||
public bool SuppressReturningExceptions {
|
||||
get { return (bool) base [suppressReturningExceptionsProp];}
|
||||
set { base[suppressReturningExceptionsProp] = value; }
|
||||
}
|
||||
|
||||
protected override ConfigurationPropertyCollection Properties {
|
||||
get { return properties; }
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,38 +0,0 @@
|
||||
//
|
||||
// System.Web.Services.Configuration.PriorityGroup
|
||||
//
|
||||
// Authors:
|
||||
// Chris Toshok (toshok@ximian.com)
|
||||
//
|
||||
// (C) 2006 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.
|
||||
//
|
||||
|
||||
|
||||
namespace System.Web.Services.Configuration {
|
||||
public enum PriorityGroup {
|
||||
High = 0,
|
||||
Low = 1
|
||||
}
|
||||
}
|
||||
|
@ -1,75 +0,0 @@
|
||||
//
|
||||
// System.Web.Services.Configuration.ProtocolElement
|
||||
//
|
||||
// Authors:
|
||||
// Chris Toshok (toshok@ximian.com)
|
||||
//
|
||||
// (C) 2006 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.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Configuration;
|
||||
|
||||
|
||||
namespace System.Web.Services.Configuration {
|
||||
|
||||
public sealed class ProtocolElement : ConfigurationElement
|
||||
{
|
||||
static ConfigurationProperty nameProp;
|
||||
static ConfigurationPropertyCollection properties;
|
||||
|
||||
static ProtocolElement ()
|
||||
{
|
||||
nameProp = new ConfigurationProperty ("name", typeof (WebServiceProtocols), WebServiceProtocols.Unknown,
|
||||
new GenericEnumConverter (typeof (WebServiceProtocols)), null, ConfigurationPropertyOptions.IsKey);
|
||||
properties = new ConfigurationPropertyCollection ();
|
||||
|
||||
properties.Add (nameProp);
|
||||
|
||||
}
|
||||
|
||||
public ProtocolElement ()
|
||||
{
|
||||
}
|
||||
|
||||
public ProtocolElement (WebServiceProtocols protocol)
|
||||
{
|
||||
this.Name = protocol;
|
||||
}
|
||||
|
||||
[ConfigurationProperty ("name", DefaultValue = WebServiceProtocols.Unknown, Options = ConfigurationPropertyOptions.IsKey)]
|
||||
public WebServiceProtocols Name {
|
||||
get { return (WebServiceProtocols) base [nameProp];}
|
||||
set { base[nameProp] = value; }
|
||||
}
|
||||
|
||||
protected override ConfigurationPropertyCollection Properties {
|
||||
get { return properties; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,115 +0,0 @@
|
||||
//
|
||||
// System.Web.Services.Configuration.ProtocolElementCollection
|
||||
//
|
||||
// Authors:
|
||||
// Chris Toshok (toshok@ximian.com)
|
||||
//
|
||||
// (C) 2006 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.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Configuration;
|
||||
|
||||
|
||||
namespace System.Web.Services.Configuration {
|
||||
|
||||
[ConfigurationCollection (typeof (ProtocolElement), CollectionType = ConfigurationElementCollectionType.AddRemoveClearMap)]
|
||||
public sealed class ProtocolElementCollection : ConfigurationElementCollection
|
||||
{
|
||||
public void Add (ProtocolElement element)
|
||||
{
|
||||
BaseAdd (element);
|
||||
}
|
||||
|
||||
public void Clear ()
|
||||
{
|
||||
BaseClear ();
|
||||
}
|
||||
|
||||
public bool ContainsKey (object key)
|
||||
{
|
||||
return (BaseGet (key) != null);
|
||||
}
|
||||
|
||||
public void CopyTo (ProtocolElement[] array, int index)
|
||||
{
|
||||
((ICollection)this).CopyTo (array, index);
|
||||
}
|
||||
|
||||
protected override ConfigurationElement CreateNewElement ()
|
||||
{
|
||||
return new ProtocolElement ();
|
||||
}
|
||||
|
||||
protected override object GetElementKey (ConfigurationElement element)
|
||||
{
|
||||
return ((ProtocolElement)element).Name;
|
||||
}
|
||||
|
||||
public int IndexOf (ProtocolElement element)
|
||||
{
|
||||
return BaseIndexOf (element);
|
||||
}
|
||||
|
||||
public void Remove (ProtocolElement element)
|
||||
{
|
||||
BaseRemove (element.Name);
|
||||
}
|
||||
|
||||
public void RemoveAt (int index)
|
||||
{
|
||||
BaseRemoveAt (index);
|
||||
}
|
||||
|
||||
[MonoTODO ("is this right?")]
|
||||
public void RemoveAt (object key)
|
||||
{
|
||||
BaseRemove (key);
|
||||
}
|
||||
|
||||
public ProtocolElement this [int index] {
|
||||
get { return (ProtocolElement)BaseGet (index); }
|
||||
set { if (BaseGet (index) != null) BaseRemoveAt (index); BaseAdd (index, value); }
|
||||
}
|
||||
|
||||
public ProtocolElement this [object key] {
|
||||
get { return (ProtocolElement)BaseGet (key); }
|
||||
set {
|
||||
ProtocolElement el = (ProtocolElement)BaseGet (key);
|
||||
if (el == null) {
|
||||
BaseAdd (value);
|
||||
return;
|
||||
}
|
||||
int index = IndexOf (el);
|
||||
BaseRemoveAt (index);
|
||||
BaseAdd (index, value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,93 +0,0 @@
|
||||
//
|
||||
// System.Web.Services.Configuration.SoapEnvelopeProcessingElement
|
||||
//
|
||||
// Authors:
|
||||
// Chris Toshok (toshok@ximian.com)
|
||||
//
|
||||
// (C) 2006 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.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.ComponentModel;
|
||||
|
||||
|
||||
namespace System.Web.Services.Configuration {
|
||||
|
||||
public sealed class SoapEnvelopeProcessingElement : ConfigurationElement
|
||||
{
|
||||
static ConfigurationProperty strictProp;
|
||||
static ConfigurationProperty readTimeoutProp;
|
||||
static ConfigurationPropertyCollection properties;
|
||||
|
||||
static SoapEnvelopeProcessingElement ()
|
||||
{
|
||||
strictProp = new ConfigurationProperty ("strict", typeof (bool), false);
|
||||
readTimeoutProp = new ConfigurationProperty ("readTimeout", typeof (int), Int32.MaxValue,
|
||||
new InfiniteIntConverter(), null,
|
||||
ConfigurationPropertyOptions.None);
|
||||
properties = new ConfigurationPropertyCollection ();
|
||||
|
||||
properties.Add (strictProp);
|
||||
properties.Add (readTimeoutProp);
|
||||
|
||||
}
|
||||
|
||||
public SoapEnvelopeProcessingElement (int readTimeout, bool strict)
|
||||
{
|
||||
ReadTimeout = readTimeout;
|
||||
IsStrict = strict;
|
||||
}
|
||||
|
||||
public SoapEnvelopeProcessingElement (int readTimeout)
|
||||
{
|
||||
ReadTimeout = readTimeout;
|
||||
}
|
||||
|
||||
public SoapEnvelopeProcessingElement ()
|
||||
{
|
||||
}
|
||||
|
||||
[ConfigurationProperty ("strict", DefaultValue = false)]
|
||||
public bool IsStrict {
|
||||
get { return (bool) base [strictProp];}
|
||||
set { base[strictProp] = value; }
|
||||
}
|
||||
|
||||
[TypeConverter (typeof (InfiniteIntConverter))]
|
||||
[ConfigurationProperty ("readTimeout", DefaultValue = int.MaxValue)]
|
||||
public int ReadTimeout {
|
||||
get { return (int) base [readTimeoutProp];}
|
||||
set { base[readTimeoutProp] = value; }
|
||||
}
|
||||
|
||||
protected override ConfigurationPropertyCollection Properties {
|
||||
get { return properties; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,114 +0,0 @@
|
||||
//
|
||||
// System.Web.Services.Configuration.SoapExtensionTypeElement
|
||||
//
|
||||
// Authors:
|
||||
// Chris Toshok (toshok@ximian.com)
|
||||
// Atsushi Enomoto (atsushi@ximian.com)
|
||||
//
|
||||
// (C) 2006-2007 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.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Security.Permissions;
|
||||
|
||||
|
||||
namespace System.Web.Services.Configuration {
|
||||
|
||||
public sealed class SoapExtensionTypeElement : ConfigurationElement
|
||||
{
|
||||
static ConfigurationProperty groupProp;
|
||||
static ConfigurationProperty priorityProp;
|
||||
static ConfigurationProperty typeProp;
|
||||
static ConfigurationPropertyCollection properties;
|
||||
|
||||
static SoapExtensionTypeElement ()
|
||||
{
|
||||
groupProp = new ConfigurationProperty ("group", typeof (PriorityGroup), PriorityGroup.Low, ConfigurationPropertyOptions.IsKey);
|
||||
priorityProp = new ConfigurationProperty ("priority", typeof (int), 0,
|
||||
new Int32Converter(), new IntegerValidator (0, Int32.MaxValue),
|
||||
ConfigurationPropertyOptions.IsKey);
|
||||
typeProp = new ConfigurationProperty ("type", typeof (Type), null,
|
||||
new TypeTypeConverter (),
|
||||
null, ConfigurationPropertyOptions.IsKey);
|
||||
properties = new ConfigurationPropertyCollection ();
|
||||
|
||||
properties.Add (groupProp);
|
||||
properties.Add (priorityProp);
|
||||
properties.Add (typeProp);
|
||||
|
||||
}
|
||||
|
||||
public SoapExtensionTypeElement (Type type, int priority, PriorityGroup group)
|
||||
{
|
||||
this.Type = type;
|
||||
this.Priority = priority;
|
||||
this.Group = group;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public SoapExtensionTypeElement (string type, int priority, PriorityGroup group)
|
||||
: this (Type.GetType (type), priority, group)
|
||||
{
|
||||
}
|
||||
|
||||
public SoapExtensionTypeElement ()
|
||||
{
|
||||
}
|
||||
|
||||
[ConfigurationProperty ("group", DefaultValue = PriorityGroup.Low, Options = ConfigurationPropertyOptions.IsKey)]
|
||||
public PriorityGroup Group {
|
||||
get { return (PriorityGroup) base [groupProp];}
|
||||
set { base[groupProp] = value; }
|
||||
}
|
||||
|
||||
[IntegerValidator (MaxValue = int.MaxValue)]
|
||||
[ConfigurationProperty ("priority", DefaultValue = 0, Options = ConfigurationPropertyOptions.IsKey)]
|
||||
public int Priority {
|
||||
get { return (int) base [priorityProp];}
|
||||
set { base[priorityProp] = value; }
|
||||
}
|
||||
|
||||
[TypeConverter (typeof (TypeTypeConverter))]
|
||||
[ConfigurationProperty ("type", Options = ConfigurationPropertyOptions.IsKey)]
|
||||
public Type Type {
|
||||
get { return (Type) base [typeProp];}
|
||||
set { base[typeProp] = value; }
|
||||
}
|
||||
|
||||
internal object GetKey ()
|
||||
{
|
||||
return String.Format ("{0}-{0}-{0}", Type, Priority, Group);
|
||||
}
|
||||
|
||||
protected override ConfigurationPropertyCollection Properties {
|
||||
get { return properties; }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,115 +0,0 @@
|
||||
//
|
||||
// System.Web.Services.Configuration.SoapExtensionTypeElementCollection
|
||||
//
|
||||
// Authors:
|
||||
// Chris Toshok (toshok@ximian.com)
|
||||
//
|
||||
// (C) 2006 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.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Configuration;
|
||||
|
||||
|
||||
namespace System.Web.Services.Configuration {
|
||||
|
||||
[ConfigurationCollection (typeof (SoapExtensionTypeElement), CollectionType = ConfigurationElementCollectionType.AddRemoveClearMap)]
|
||||
public sealed class SoapExtensionTypeElementCollection : ConfigurationElementCollection
|
||||
{
|
||||
public void Add (SoapExtensionTypeElement element)
|
||||
{
|
||||
BaseAdd (element);
|
||||
}
|
||||
|
||||
public void Clear ()
|
||||
{
|
||||
BaseClear ();
|
||||
}
|
||||
|
||||
public bool ContainsKey (object key)
|
||||
{
|
||||
return (BaseGet (key) != null);
|
||||
}
|
||||
|
||||
public void CopyTo (SoapExtensionTypeElement[] array, int index)
|
||||
{
|
||||
((ICollection)this).CopyTo (array, index);
|
||||
}
|
||||
|
||||
protected override ConfigurationElement CreateNewElement ()
|
||||
{
|
||||
return new SoapExtensionTypeElement ();
|
||||
}
|
||||
|
||||
protected override object GetElementKey (ConfigurationElement element)
|
||||
{
|
||||
return ((SoapExtensionTypeElement)element).GetKey();
|
||||
}
|
||||
|
||||
public int IndexOf (SoapExtensionTypeElement element)
|
||||
{
|
||||
return BaseIndexOf (element);
|
||||
}
|
||||
|
||||
public void Remove (SoapExtensionTypeElement element)
|
||||
{
|
||||
BaseRemove (element.GetKey());
|
||||
}
|
||||
|
||||
public void RemoveAt (int index)
|
||||
{
|
||||
BaseRemoveAt (index);
|
||||
}
|
||||
|
||||
[MonoTODO ("is this right?")]
|
||||
public void RemoveAt (object key)
|
||||
{
|
||||
BaseRemove (key);
|
||||
}
|
||||
|
||||
public SoapExtensionTypeElement this [int index] {
|
||||
get { return (SoapExtensionTypeElement)BaseGet (index); }
|
||||
set { if (BaseGet (index) != null) BaseRemoveAt (index); BaseAdd (index, value); }
|
||||
}
|
||||
|
||||
public SoapExtensionTypeElement this [object key] {
|
||||
get { return (SoapExtensionTypeElement)BaseGet (key); }
|
||||
set {
|
||||
SoapExtensionTypeElement el = (SoapExtensionTypeElement)BaseGet (key);
|
||||
if (el == null) {
|
||||
BaseAdd (value);
|
||||
return;
|
||||
}
|
||||
int index = IndexOf (el);
|
||||
BaseRemoveAt (index);
|
||||
BaseAdd (index, value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,83 +0,0 @@
|
||||
//
|
||||
// System.Web.Services.Configuration.TypeElement
|
||||
//
|
||||
// Authors:
|
||||
// Chris Toshok (toshok@ximian.com)
|
||||
//
|
||||
// (C) 2006 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.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.ComponentModel;
|
||||
|
||||
|
||||
namespace System.Web.Services.Configuration {
|
||||
|
||||
public sealed class TypeElement : ConfigurationElement
|
||||
{
|
||||
static ConfigurationProperty typeProp;
|
||||
static ConfigurationPropertyCollection properties;
|
||||
|
||||
static TypeElement ()
|
||||
{
|
||||
typeProp = new ConfigurationProperty ("type", typeof (Type), null, new TypeTypeConverter(),
|
||||
null, ConfigurationPropertyOptions.IsKey);
|
||||
properties = new ConfigurationPropertyCollection ();
|
||||
|
||||
properties.Add (typeProp);
|
||||
|
||||
}
|
||||
|
||||
public TypeElement (Type type)
|
||||
{
|
||||
this.Type = type;
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public TypeElement (string type)
|
||||
: this (Type.GetType (type))
|
||||
{
|
||||
}
|
||||
|
||||
public TypeElement ()
|
||||
{
|
||||
}
|
||||
|
||||
[TypeConverter (typeof (TypeTypeConverter))]
|
||||
[ConfigurationProperty ("type", Options = ConfigurationPropertyOptions.IsKey)]
|
||||
public Type Type {
|
||||
get { return (Type) base [typeProp];}
|
||||
set { base[typeProp] = value; }
|
||||
}
|
||||
|
||||
protected override ConfigurationPropertyCollection Properties {
|
||||
get { return properties; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,115 +0,0 @@
|
||||
//
|
||||
// System.Web.Services.Configuration.TypeElementCollection
|
||||
//
|
||||
// Authors:
|
||||
// Chris Toshok (toshok@ximian.com)
|
||||
//
|
||||
// (C) 2006 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.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Configuration;
|
||||
|
||||
|
||||
namespace System.Web.Services.Configuration {
|
||||
|
||||
[ConfigurationCollection (typeof (TypeElement), CollectionType = ConfigurationElementCollectionType.AddRemoveClearMap)]
|
||||
public sealed class TypeElementCollection : ConfigurationElementCollection
|
||||
{
|
||||
public void Add (TypeElement element)
|
||||
{
|
||||
BaseAdd (element);
|
||||
}
|
||||
|
||||
public void Clear ()
|
||||
{
|
||||
BaseClear ();
|
||||
}
|
||||
|
||||
public bool ContainsKey (object key)
|
||||
{
|
||||
return (BaseGet (key) != null);
|
||||
}
|
||||
|
||||
public void CopyTo (TypeElement[] array, int index)
|
||||
{
|
||||
((ICollection)this).CopyTo (array, index);
|
||||
}
|
||||
|
||||
protected override ConfigurationElement CreateNewElement ()
|
||||
{
|
||||
return new TypeElement ();
|
||||
}
|
||||
|
||||
protected override object GetElementKey (ConfigurationElement element)
|
||||
{
|
||||
return ((TypeElement)element).Type;
|
||||
}
|
||||
|
||||
public int IndexOf (TypeElement element)
|
||||
{
|
||||
return BaseIndexOf (element);
|
||||
}
|
||||
|
||||
public void Remove (TypeElement element)
|
||||
{
|
||||
BaseRemove (element.Type);
|
||||
}
|
||||
|
||||
public void RemoveAt (int index)
|
||||
{
|
||||
BaseRemoveAt (index);
|
||||
}
|
||||
|
||||
[MonoTODO ("is this right?")]
|
||||
public void RemoveAt (object key)
|
||||
{
|
||||
BaseRemove (key);
|
||||
}
|
||||
|
||||
public TypeElement this [int index] {
|
||||
get { return (TypeElement)BaseGet (index); }
|
||||
set { if (BaseGet (index) != null) BaseRemoveAt (index); BaseAdd (index, value); }
|
||||
}
|
||||
|
||||
public TypeElement this [object key] {
|
||||
get { return (TypeElement)BaseGet (key); }
|
||||
set {
|
||||
TypeElement el = (TypeElement)BaseGet (key);
|
||||
if (el == null) {
|
||||
BaseAdd (value);
|
||||
return;
|
||||
}
|
||||
int index = IndexOf (el);
|
||||
BaseRemoveAt (index);
|
||||
BaseAdd (index, value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,80 +0,0 @@
|
||||
//
|
||||
// TypeTypeConverter.cs
|
||||
//
|
||||
// Author:
|
||||
// Atsushi Enomoto (atsushi@ximian.com)
|
||||
//
|
||||
// (C) 2007 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.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Security.Permissions;
|
||||
|
||||
|
||||
namespace System.Web.Services.Configuration
|
||||
{
|
||||
internal class TypeTypeConverter : TypeConverter
|
||||
{
|
||||
public override bool CanConvertFrom (ITypeDescriptorContext context, Type type)
|
||||
{
|
||||
return type == typeof (Type) || type == typeof (string);
|
||||
}
|
||||
|
||||
public override bool CanConvertTo (ITypeDescriptorContext context, Type type)
|
||||
{
|
||||
return type == typeof (Type) || type == typeof (string);
|
||||
}
|
||||
|
||||
public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value)
|
||||
{
|
||||
if (value == null)
|
||||
throw new ArgumentNullException ("value");
|
||||
if (value is Type)
|
||||
return (Type) value;
|
||||
else if (value is string)
|
||||
return Type.GetType ((string) value);
|
||||
else
|
||||
throw new ArgumentException (String.Format ("Incompatible input value type: {0}", value.GetType ()));
|
||||
}
|
||||
|
||||
public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
|
||||
{
|
||||
if (value == null)
|
||||
throw new ArgumentNullException ("value");
|
||||
if (destinationType == null)
|
||||
throw new ArgumentNullException ("destinationType");
|
||||
if (destinationType == typeof (Type))
|
||||
return (Type) value;
|
||||
if (destinationType == typeof (string))
|
||||
return ((Type) value).AssemblyQualifiedName;
|
||||
else
|
||||
throw new ArgumentException (String.Format ("Incompatible input destination type: {0}", destinationType));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,46 +0,0 @@
|
||||
//
|
||||
// System.Web.Services.Configuration.WebServiceProtocols
|
||||
//
|
||||
// Authors:
|
||||
// Chris Toshok (toshok@ximian.com)
|
||||
//
|
||||
// (C) 2006 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.
|
||||
//
|
||||
|
||||
|
||||
namespace System.Web.Services.Configuration {
|
||||
|
||||
[Flags]
|
||||
public enum WebServiceProtocols {
|
||||
Unknown = 0,
|
||||
HttpSoap = 1,
|
||||
HttpGet = 1 << 1,
|
||||
HttpPost = 1 << 2,
|
||||
Documentation = 1 << 3,
|
||||
HttpPostLocalhost = 1 << 4,
|
||||
HttpSoap12 = 1 << 5,
|
||||
AnyHttpSoap = HttpSoap | HttpSoap12
|
||||
}
|
||||
}
|
||||
|
@ -1,497 +0,0 @@
|
||||
//
|
||||
// System.Web.Services.Configuration.WebServicesConfigurationSectionHandler
|
||||
//
|
||||
// Authors:
|
||||
// Gonzalo Paniagua Javier (gonzalo@ximian.com)
|
||||
//
|
||||
// (C) 2003 Ximian, Inc (http://www.ximian.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.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Configuration;
|
||||
using System.Xml;
|
||||
|
||||
namespace System.Web.Services.Configuration
|
||||
{
|
||||
[Flags]
|
||||
enum WSProtocol
|
||||
{
|
||||
HttpSoap = 1,
|
||||
HttpPost = 1 << 1,
|
||||
HttpGet = 1 << 2,
|
||||
Documentation = 1 << 3,
|
||||
HttpSoap12 = 1 << 4,
|
||||
HttpPostLocalhost = 1 << 5,
|
||||
AnyHttpSoap = HttpSoap | HttpSoap12,
|
||||
All = 0xFF
|
||||
}
|
||||
|
||||
class WSConfig
|
||||
{
|
||||
volatile static WSConfig instance;
|
||||
WSProtocol protocols;
|
||||
string wsdlHelpPage;
|
||||
string filePath;
|
||||
ArrayList extensionTypes = new ArrayList();
|
||||
ArrayList extensionImporterTypes = new ArrayList();
|
||||
ArrayList extensionReflectorTypes = new ArrayList();
|
||||
ArrayList formatExtensionTypes = new ArrayList();
|
||||
static readonly object lockobj = new object ();
|
||||
|
||||
public WSConfig (WSConfig parent, object context)
|
||||
{
|
||||
if (parent == null)
|
||||
return;
|
||||
|
||||
protocols = parent.protocols;
|
||||
wsdlHelpPage = parent.wsdlHelpPage;
|
||||
if (wsdlHelpPage != null)
|
||||
filePath = parent.filePath;
|
||||
else
|
||||
filePath = context as string;
|
||||
}
|
||||
|
||||
static WSProtocol ParseProtocol (string protoName, out string error)
|
||||
{
|
||||
WSProtocol proto;
|
||||
error = null;
|
||||
|
||||
try {
|
||||
proto = (WSProtocol) Enum.Parse (typeof (WSProtocol), protoName);
|
||||
} catch {
|
||||
error = "Invalid protocol name";
|
||||
return 0;
|
||||
}
|
||||
|
||||
return proto;
|
||||
}
|
||||
|
||||
// Methods to modify configuration values
|
||||
public bool AddProtocol (string protoName, out string error)
|
||||
{
|
||||
if (protoName == "All") {
|
||||
error = "Invalid protocol name";
|
||||
return false;
|
||||
}
|
||||
|
||||
WSProtocol proto = ParseProtocol (protoName, out error);
|
||||
if (error != null)
|
||||
return false;
|
||||
|
||||
protocols |= proto;
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool RemoveProtocol (string protoName, out string error)
|
||||
{
|
||||
if (protoName == "All") {
|
||||
error = "Invalid protocol name";
|
||||
return false;
|
||||
}
|
||||
|
||||
WSProtocol proto = ParseProtocol (protoName, out error);
|
||||
if (error != null)
|
||||
return false;
|
||||
|
||||
protocols &= ~proto;
|
||||
return true;
|
||||
}
|
||||
|
||||
public void ClearProtocol ()
|
||||
{
|
||||
protocols = 0;
|
||||
}
|
||||
|
||||
// Methods to query/get configuration
|
||||
public static bool IsSupported (WSProtocol proto)
|
||||
{
|
||||
return ((Instance.protocols & proto) == proto && (proto != 0) && (proto != WSProtocol.All));
|
||||
}
|
||||
|
||||
// Properties
|
||||
public string WsdlHelpPage {
|
||||
get { return wsdlHelpPage; }
|
||||
set { wsdlHelpPage = value; }
|
||||
}
|
||||
|
||||
public string ConfigFilePath {
|
||||
get { return filePath; }
|
||||
set { filePath = value; }
|
||||
}
|
||||
|
||||
static public WSConfig Instance {
|
||||
get {
|
||||
//TODO: use HttpContext to get the configuration
|
||||
if (instance != null)
|
||||
return instance;
|
||||
|
||||
lock (lockobj) {
|
||||
if (instance != null)
|
||||
return instance;
|
||||
|
||||
instance = (WSConfig) ConfigurationSettings.GetConfig ("system.web/webServices");
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList ExtensionTypes {
|
||||
get { return extensionTypes; }
|
||||
}
|
||||
|
||||
public ArrayList ExtensionImporterTypes {
|
||||
get { return extensionImporterTypes; }
|
||||
}
|
||||
|
||||
public ArrayList ExtensionReflectorTypes {
|
||||
get { return extensionReflectorTypes; }
|
||||
}
|
||||
|
||||
public ArrayList FormatExtensionTypes {
|
||||
get { return formatExtensionTypes; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
enum WSExtensionGroup
|
||||
{
|
||||
High,
|
||||
Low
|
||||
}
|
||||
|
||||
class WSExtensionConfig
|
||||
{
|
||||
Type type;
|
||||
int priority;
|
||||
WSExtensionGroup group;
|
||||
|
||||
public Exception SetType (string typeName)
|
||||
{
|
||||
Exception exc = null;
|
||||
|
||||
try {
|
||||
type = Type.GetType (typeName, true);
|
||||
} catch (Exception e) {
|
||||
exc = e;
|
||||
}
|
||||
|
||||
return exc;
|
||||
}
|
||||
|
||||
public Exception SetPriority (string prio)
|
||||
{
|
||||
if (prio == null || prio == "")
|
||||
return null;
|
||||
|
||||
Exception exc = null;
|
||||
try {
|
||||
priority = Int32.Parse (prio);
|
||||
} catch (Exception e) {
|
||||
exc = e;
|
||||
}
|
||||
|
||||
return exc;
|
||||
}
|
||||
|
||||
public Exception SetGroup (string grp)
|
||||
{
|
||||
if (grp == null || grp == "")
|
||||
return null;
|
||||
|
||||
Exception exc = null;
|
||||
try {
|
||||
group = (WSExtensionGroup) Int32.Parse (grp);
|
||||
if (group < WSExtensionGroup.High || group > WSExtensionGroup.Low)
|
||||
throw new ArgumentOutOfRangeException ("group", "Must be 0 or 1");
|
||||
} catch (Exception e) {
|
||||
exc = e;
|
||||
}
|
||||
|
||||
return exc;
|
||||
}
|
||||
|
||||
// Getters
|
||||
public Type Type {
|
||||
get { return type; }
|
||||
}
|
||||
|
||||
public int Priority {
|
||||
get { return priority; }
|
||||
}
|
||||
|
||||
public WSExtensionGroup Group {
|
||||
get { return group; }
|
||||
}
|
||||
}
|
||||
|
||||
class WebServicesConfigurationSectionHandler : IConfigurationSectionHandler
|
||||
{
|
||||
public object Create (object parent, object context, XmlNode section)
|
||||
{
|
||||
WSConfig config = new WSConfig (parent as WSConfig, context);
|
||||
|
||||
if (section.Attributes != null && section.Attributes.Count != 0)
|
||||
ThrowException ("Unrecognized attribute", section);
|
||||
|
||||
XmlNodeList nodes = section.ChildNodes;
|
||||
foreach (XmlNode child in nodes) {
|
||||
XmlNodeType ntype = child.NodeType;
|
||||
if (ntype == XmlNodeType.Whitespace || ntype == XmlNodeType.Comment)
|
||||
continue;
|
||||
|
||||
if (ntype != XmlNodeType.Element)
|
||||
ThrowException ("Only elements allowed", child);
|
||||
|
||||
string name = child.Name;
|
||||
if (name == "protocols") {
|
||||
ConfigProtocols (child, config);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (name == "soapExtensionTypes") {
|
||||
ConfigSoapExtensionTypes (child, config.ExtensionTypes);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (name == "soapExtensionReflectorTypes") {
|
||||
ConfigSoapExtensionTypes (child, config.ExtensionReflectorTypes);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (name == "soapExtensionImporterTypes") {
|
||||
ConfigSoapExtensionTypes (child, config.ExtensionImporterTypes);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (name == "serviceDescriptionFormatExtensionTypes") {
|
||||
ConfigFormatExtensionTypes (child, config);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (name == "wsdlHelpGenerator") {
|
||||
string href = AttValue ("href", child, false);
|
||||
if (child.Attributes != null && child.Attributes.Count != 0)
|
||||
HandlersUtil.ThrowException ("Unrecognized attribute", child);
|
||||
|
||||
config.ConfigFilePath = context as string;
|
||||
config.WsdlHelpPage = href;
|
||||
continue;
|
||||
}
|
||||
|
||||
ThrowException ("Unexpected element", child);
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
static void ConfigProtocols (XmlNode section, WSConfig config)
|
||||
{
|
||||
if (section.Attributes != null && section.Attributes.Count != 0)
|
||||
ThrowException ("Unrecognized attribute", section);
|
||||
|
||||
XmlNodeList nodes = section.ChildNodes;
|
||||
foreach (XmlNode child in nodes) {
|
||||
XmlNodeType ntype = child.NodeType;
|
||||
if (ntype == XmlNodeType.Whitespace || ntype == XmlNodeType.Comment)
|
||||
continue;
|
||||
|
||||
if (ntype != XmlNodeType.Element)
|
||||
ThrowException ("Only elements allowed", child);
|
||||
|
||||
string name = child.Name;
|
||||
string error;
|
||||
if (name == "add") {
|
||||
string protoName = AttValue ("name", child, false);
|
||||
if (child.Attributes != null && child.Attributes.Count != 0)
|
||||
HandlersUtil.ThrowException ("Unrecognized attribute", child);
|
||||
|
||||
if (!config.AddProtocol (protoName, out error))
|
||||
ThrowException (error, child);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (name == "remove") {
|
||||
string protoName = AttValue ("name", child, false);
|
||||
if (child.Attributes != null && child.Attributes.Count != 0)
|
||||
HandlersUtil.ThrowException ("Unrecognized attribute", child);
|
||||
|
||||
if (!config.RemoveProtocol (protoName, out error))
|
||||
ThrowException (error, child);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (name == "clear") {
|
||||
if (child.Attributes != null && child.Attributes.Count != 0)
|
||||
HandlersUtil.ThrowException ("Unrecognized attribute", child);
|
||||
|
||||
config.ClearProtocol ();
|
||||
continue;
|
||||
}
|
||||
|
||||
ThrowException ("Unexpected element", child);
|
||||
}
|
||||
}
|
||||
|
||||
static void ConfigSoapExtensionTypes (XmlNode section, ArrayList extensions)
|
||||
{
|
||||
if (section.Attributes != null && section.Attributes.Count != 0)
|
||||
ThrowException ("Unrecognized attribute", section);
|
||||
|
||||
XmlNodeList nodes = section.ChildNodes;
|
||||
foreach (XmlNode child in nodes) {
|
||||
XmlNodeType ntype = child.NodeType;
|
||||
if (ntype == XmlNodeType.Whitespace || ntype == XmlNodeType.Comment)
|
||||
continue;
|
||||
|
||||
if (ntype != XmlNodeType.Element)
|
||||
ThrowException ("Only elements allowed", child);
|
||||
|
||||
string name = child.Name;
|
||||
if (name == "add") {
|
||||
string seType = AttValue ("type", child, false);
|
||||
string priority = AttValue ("priority", child);
|
||||
string group = AttValue ("group", child);
|
||||
if (child.Attributes != null && child.Attributes.Count != 0)
|
||||
HandlersUtil.ThrowException ("Unrecognized attribute", child);
|
||||
|
||||
WSExtensionConfig wse = new WSExtensionConfig ();
|
||||
Exception e = wse.SetType (seType);
|
||||
if (e != null)
|
||||
ThrowException (e.Message, child);
|
||||
|
||||
e = wse.SetPriority (priority);
|
||||
if (e != null)
|
||||
ThrowException (e.Message, child);
|
||||
|
||||
e = wse.SetGroup (group);
|
||||
if (e != null)
|
||||
ThrowException (e.Message, child);
|
||||
|
||||
extensions.Add (wse);
|
||||
continue;
|
||||
}
|
||||
|
||||
ThrowException ("Unexpected element", child);
|
||||
}
|
||||
}
|
||||
|
||||
static void ConfigFormatExtensionTypes (XmlNode section, WSConfig config)
|
||||
{
|
||||
if (section.Attributes != null && section.Attributes.Count != 0)
|
||||
ThrowException ("Unrecognized attribute", section);
|
||||
|
||||
XmlNodeList nodes = section.ChildNodes;
|
||||
foreach (XmlNode child in nodes) {
|
||||
XmlNodeType ntype = child.NodeType;
|
||||
if (ntype == XmlNodeType.Whitespace || ntype == XmlNodeType.Comment)
|
||||
continue;
|
||||
|
||||
if (ntype != XmlNodeType.Element)
|
||||
ThrowException ("Only elements allowed", child);
|
||||
|
||||
string name = child.Name;
|
||||
if (name == "add") {
|
||||
string typeName = AttValue ("name", child, false);
|
||||
if (child.Attributes != null && child.Attributes.Count != 0)
|
||||
HandlersUtil.ThrowException ("Unrecognized attribute", child);
|
||||
|
||||
try {
|
||||
config.FormatExtensionTypes.Add (Type.GetType (typeName, true));
|
||||
} catch (Exception e) {
|
||||
ThrowException (e.Message, child);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
ThrowException ("Unexpected element", child);
|
||||
}
|
||||
}
|
||||
|
||||
// To save some typing...
|
||||
static string AttValue (string name, XmlNode node, bool optional)
|
||||
{
|
||||
return HandlersUtil.ExtractAttributeValue (name, node, optional);
|
||||
}
|
||||
|
||||
static string AttValue (string name, XmlNode node)
|
||||
{
|
||||
return HandlersUtil.ExtractAttributeValue (name, node, true);
|
||||
}
|
||||
|
||||
static void ThrowException (string message, XmlNode node)
|
||||
{
|
||||
HandlersUtil.ThrowException (message, node);
|
||||
}
|
||||
//
|
||||
}
|
||||
|
||||
class HandlersUtil
|
||||
{
|
||||
private HandlersUtil ()
|
||||
{
|
||||
}
|
||||
|
||||
static internal string ExtractAttributeValue (string attKey, XmlNode node)
|
||||
{
|
||||
return ExtractAttributeValue (attKey, node, false);
|
||||
}
|
||||
|
||||
static internal string ExtractAttributeValue (string attKey, XmlNode node, bool optional)
|
||||
{
|
||||
if (node.Attributes == null) {
|
||||
if (optional)
|
||||
return null;
|
||||
|
||||
ThrowException ("Required attribute not found: " + attKey, node);
|
||||
}
|
||||
|
||||
XmlNode att = node.Attributes.RemoveNamedItem (attKey);
|
||||
if (att == null) {
|
||||
if (optional)
|
||||
return null;
|
||||
ThrowException ("Required attribute not found: " + attKey, node);
|
||||
}
|
||||
|
||||
string value = att.Value;
|
||||
if (value == String.Empty) {
|
||||
string opt = optional ? "Optional" : "Required";
|
||||
ThrowException (opt + " attribute is empty: " + attKey, node);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
static internal void ThrowException (string msg, XmlNode node)
|
||||
{
|
||||
if (node != null && node.Name != String.Empty)
|
||||
msg = msg + " (node name: " + node.Name + ") ";
|
||||
throw new ConfigurationException (msg, node);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,191 +0,0 @@
|
||||
//
|
||||
// System.Web.Services.Configuration.WebServicesSection
|
||||
//
|
||||
// Authors:
|
||||
// Chris Toshok (toshok@ximian.com)
|
||||
//
|
||||
// (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.
|
||||
//
|
||||
|
||||
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Web.Configuration;
|
||||
|
||||
namespace System.Web.Services.Configuration
|
||||
{
|
||||
public sealed class WebServicesSection : ConfigurationSection
|
||||
{
|
||||
static ConfigurationProperty conformanceWarningsProp;
|
||||
static ConfigurationProperty diagnosticsProp;
|
||||
static ConfigurationProperty protocolsProp;
|
||||
static ConfigurationProperty serviceDescriptionFormatExtensionTypesProp;
|
||||
static ConfigurationProperty soapEnvelopeProcessingProp;
|
||||
static ConfigurationProperty soapExtensionImporterTypesProp;
|
||||
static ConfigurationProperty soapExtensionReflectorTypesProp;
|
||||
static ConfigurationProperty soapExtensionTypesProp;
|
||||
static ConfigurationProperty soapServerProtocolFactoryProp;
|
||||
static ConfigurationProperty soapTransportImporterTypesProp;
|
||||
static ConfigurationProperty wsdlHelpGeneratorProp;
|
||||
static ConfigurationPropertyCollection properties;
|
||||
|
||||
static WebServicesSection ()
|
||||
{
|
||||
conformanceWarningsProp = new ConfigurationProperty ("conformanceWarnings", typeof (WsiProfilesElementCollection), null,
|
||||
null, null, ConfigurationPropertyOptions.None);
|
||||
diagnosticsProp = new ConfigurationProperty ("diagnostics", typeof (DiagnosticsElement), null,
|
||||
null, null, ConfigurationPropertyOptions.None);
|
||||
protocolsProp = new ConfigurationProperty ("protocols", typeof (ProtocolElementCollection), null,
|
||||
null, null, ConfigurationPropertyOptions.None);
|
||||
serviceDescriptionFormatExtensionTypesProp = new ConfigurationProperty ("serviceDescriptionFormatExtensionTypes", typeof (TypeElementCollection), null,
|
||||
null, null, ConfigurationPropertyOptions.None);
|
||||
soapEnvelopeProcessingProp = new ConfigurationProperty ("soapEnvelopeProcessing", typeof (SoapEnvelopeProcessingElement), null,
|
||||
null, null, ConfigurationPropertyOptions.None);
|
||||
soapExtensionImporterTypesProp = new ConfigurationProperty ("soapExtensionImporterTypes", typeof (TypeElementCollection), null,
|
||||
null, null, ConfigurationPropertyOptions.None);
|
||||
soapExtensionReflectorTypesProp = new ConfigurationProperty ("soapExtensionReflectorTypes", typeof (TypeElementCollection), null,
|
||||
null, null, ConfigurationPropertyOptions.None);
|
||||
soapExtensionTypesProp = new ConfigurationProperty ("soapExtensionTypes", typeof (SoapExtensionTypeElementCollection), null,
|
||||
null, null, ConfigurationPropertyOptions.None);
|
||||
soapServerProtocolFactoryProp = new ConfigurationProperty ("soapServerProtocolFactory", typeof (TypeElement), null,
|
||||
null, null, ConfigurationPropertyOptions.None);
|
||||
soapTransportImporterTypesProp = new ConfigurationProperty ("soapTransportImporterTypes", typeof (TypeElementCollection), null,
|
||||
null, null, ConfigurationPropertyOptions.None);
|
||||
wsdlHelpGeneratorProp = new ConfigurationProperty ("wsdlHelpGenerator", typeof (WsdlHelpGeneratorElement), null,
|
||||
null, null, ConfigurationPropertyOptions.None);
|
||||
properties = new ConfigurationPropertyCollection ();
|
||||
|
||||
properties.Add (conformanceWarningsProp);
|
||||
properties.Add (diagnosticsProp);
|
||||
properties.Add (protocolsProp);
|
||||
properties.Add (serviceDescriptionFormatExtensionTypesProp);
|
||||
properties.Add (soapEnvelopeProcessingProp);
|
||||
properties.Add (soapExtensionImporterTypesProp);
|
||||
properties.Add (soapExtensionReflectorTypesProp);
|
||||
properties.Add (soapExtensionTypesProp);
|
||||
properties.Add (soapServerProtocolFactoryProp);
|
||||
properties.Add (soapTransportImporterTypesProp);
|
||||
properties.Add (wsdlHelpGeneratorProp);
|
||||
|
||||
}
|
||||
|
||||
public static WebServicesSection GetSection (System.Configuration.Configuration config)
|
||||
{
|
||||
return (WebServicesSection) config.GetSection ("webServices");
|
||||
}
|
||||
|
||||
protected override void InitializeDefault ()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Reset (ConfigurationElement parentElement)
|
||||
{
|
||||
base.Reset (parentElement);
|
||||
}
|
||||
|
||||
[ConfigurationProperty ("conformanceWarnings")]
|
||||
public WsiProfilesElementCollection ConformanceWarnings {
|
||||
get { return (WsiProfilesElementCollection) base [conformanceWarningsProp];}
|
||||
}
|
||||
|
||||
public DiagnosticsElement Diagnostics {
|
||||
get { return (DiagnosticsElement) base [diagnosticsProp]; }
|
||||
set { base[diagnosticsProp] = value; }
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
WebServiceProtocols enabledProtocols = WebServiceProtocols.Unknown;
|
||||
public WebServiceProtocols EnabledProtocols {
|
||||
get {
|
||||
if (enabledProtocols == WebServiceProtocols.Unknown) {
|
||||
foreach (ProtocolElement el in Protocols)
|
||||
enabledProtocols |= el.Name;
|
||||
}
|
||||
|
||||
return enabledProtocols;
|
||||
}
|
||||
}
|
||||
|
||||
[ConfigurationProperty ("protocols")]
|
||||
public ProtocolElementCollection Protocols {
|
||||
get { return (ProtocolElementCollection) base [protocolsProp];}
|
||||
}
|
||||
|
||||
[ConfigurationProperty ("serviceDescriptionFormatExtensionTypes")]
|
||||
public TypeElementCollection ServiceDescriptionFormatExtensionTypes {
|
||||
get { return (TypeElementCollection) base [serviceDescriptionFormatExtensionTypesProp];}
|
||||
}
|
||||
|
||||
[ConfigurationProperty ("soapEnvelopeProcessing")]
|
||||
public SoapEnvelopeProcessingElement SoapEnvelopeProcessing {
|
||||
get { return (SoapEnvelopeProcessingElement) base [soapEnvelopeProcessingProp];}
|
||||
set { base[soapEnvelopeProcessingProp] = value; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty ("soapExtensionImporterTypes")]
|
||||
public TypeElementCollection SoapExtensionImporterTypes {
|
||||
get { return (TypeElementCollection) base [soapExtensionImporterTypesProp];}
|
||||
}
|
||||
|
||||
[ConfigurationProperty ("soapExtensionReflectorTypes")]
|
||||
public TypeElementCollection SoapExtensionReflectorTypes {
|
||||
get { return (TypeElementCollection) base [soapExtensionReflectorTypesProp];}
|
||||
}
|
||||
|
||||
[ConfigurationProperty ("soapExtensionTypes")]
|
||||
public SoapExtensionTypeElementCollection SoapExtensionTypes {
|
||||
get { return (SoapExtensionTypeElementCollection) base [soapExtensionTypesProp];}
|
||||
}
|
||||
|
||||
[ConfigurationProperty ("soapServerProtocolFactory")]
|
||||
public TypeElement SoapServerProtocolFactoryType {
|
||||
get { return (TypeElement) base [soapServerProtocolFactoryProp];}
|
||||
}
|
||||
|
||||
[ConfigurationProperty("soapTransportImporterTypes")]
|
||||
public TypeElementCollection SoapTransportImporterTypes {
|
||||
get { return (TypeElementCollection) base [soapTransportImporterTypesProp];}
|
||||
}
|
||||
|
||||
[ConfigurationProperty ("wsdlHelpGenerator")]
|
||||
public WsdlHelpGeneratorElement WsdlHelpGenerator {
|
||||
get { return (WsdlHelpGeneratorElement) base [wsdlHelpGeneratorProp];}
|
||||
}
|
||||
|
||||
protected override ConfigurationPropertyCollection Properties {
|
||||
get { return properties; }
|
||||
}
|
||||
|
||||
public static WebServicesSection Current {
|
||||
get { return (WebServicesSection) ConfigurationManager.GetSection ("system.web/webServices"); }
|
||||
}
|
||||
|
||||
internal static bool IsSupported (WebServiceProtocols proto)
|
||||
{
|
||||
return ((Current.EnabledProtocols & proto) == proto && (proto != WebServiceProtocols.Unknown));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,82 +0,0 @@
|
||||
//
|
||||
// System.Web.Services.Configuration.WsdlHelpGeneratorElement
|
||||
//
|
||||
// Authors:
|
||||
// Chris Toshok (toshok@ximian.com)
|
||||
//
|
||||
// (C) 2006 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.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Xml;
|
||||
|
||||
|
||||
namespace System.Web.Services.Configuration {
|
||||
|
||||
public sealed class WsdlHelpGeneratorElement : ConfigurationElement
|
||||
{
|
||||
static ConfigurationProperty hrefProp;
|
||||
static ConfigurationPropertyCollection properties;
|
||||
|
||||
static WsdlHelpGeneratorElement ()
|
||||
{
|
||||
hrefProp = new ConfigurationProperty ("href", typeof (string), null, ConfigurationPropertyOptions.IsRequired);
|
||||
properties = new ConfigurationPropertyCollection ();
|
||||
|
||||
properties.Add (hrefProp);
|
||||
|
||||
}
|
||||
|
||||
public WsdlHelpGeneratorElement ()
|
||||
{
|
||||
}
|
||||
|
||||
[MonoTODO ("probably verifies the Href property here, after deserializing?")]
|
||||
protected override void DeserializeElement (XmlReader reader, bool serializeCollectionKey)
|
||||
{
|
||||
base.DeserializeElement (reader, serializeCollectionKey);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
protected override void Reset (ConfigurationElement parentElement)
|
||||
{
|
||||
base.Reset (parentElement);
|
||||
}
|
||||
|
||||
[ConfigurationProperty ("href", Options = ConfigurationPropertyOptions.IsRequired)]
|
||||
public string Href {
|
||||
get { return (string) base [hrefProp];}
|
||||
set { base[hrefProp] = value; }
|
||||
}
|
||||
|
||||
protected override ConfigurationPropertyCollection Properties {
|
||||
get { return properties; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,78 +0,0 @@
|
||||
//
|
||||
// System.Web.Services.Configuration.WsiProfilesElement
|
||||
//
|
||||
// Authors:
|
||||
// Chris Toshok (toshok@ximian.com)
|
||||
//
|
||||
// (C) 2006 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.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Web.Services;
|
||||
|
||||
|
||||
namespace System.Web.Services.Configuration {
|
||||
|
||||
public sealed class WsiProfilesElement : ConfigurationElement
|
||||
{
|
||||
static ConfigurationProperty nameProp;
|
||||
static ConfigurationPropertyCollection properties;
|
||||
|
||||
static WsiProfilesElement ()
|
||||
{
|
||||
nameProp = new ConfigurationProperty ("name", typeof (WsiProfiles), WsiProfiles.None,
|
||||
new GenericEnumConverter (typeof (WsiProfiles)),
|
||||
null,
|
||||
ConfigurationPropertyOptions.IsKey);
|
||||
properties = new ConfigurationPropertyCollection ();
|
||||
|
||||
properties.Add (nameProp);
|
||||
|
||||
}
|
||||
|
||||
public WsiProfilesElement (WsiProfiles name)
|
||||
{
|
||||
this.Name = name;
|
||||
}
|
||||
|
||||
public WsiProfilesElement ()
|
||||
{
|
||||
}
|
||||
|
||||
[ConfigurationProperty ("name", DefaultValue = "None", Options = ConfigurationPropertyOptions.IsKey)]
|
||||
public WsiProfiles Name {
|
||||
get { return (WsiProfiles) base [nameProp];}
|
||||
set { base[nameProp] = value; }
|
||||
}
|
||||
|
||||
protected override ConfigurationPropertyCollection Properties {
|
||||
get { return properties; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,117 +0,0 @@
|
||||
//
|
||||
// System.Web.Services.Configuration.WsiProfilesElementCollection
|
||||
//
|
||||
// Authors:
|
||||
// Chris Toshok (toshok@ximian.com)
|
||||
//
|
||||
// (C) 2006 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.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Configuration;
|
||||
|
||||
|
||||
namespace System.Web.Services.Configuration {
|
||||
|
||||
[ConfigurationCollection (typeof (WsiProfilesElement), CollectionType = ConfigurationElementCollectionType.AddRemoveClearMap)]
|
||||
public sealed class WsiProfilesElementCollection : ConfigurationElementCollection
|
||||
{
|
||||
public void Add (WsiProfilesElement element)
|
||||
{
|
||||
BaseAdd (element);
|
||||
}
|
||||
|
||||
public void Clear ()
|
||||
{
|
||||
BaseClear ();
|
||||
}
|
||||
|
||||
public bool ContainsKey (object key)
|
||||
{
|
||||
return (BaseGet (key) != null);
|
||||
}
|
||||
|
||||
public void CopyTo (WsiProfilesElement[] array, int index)
|
||||
{
|
||||
((ICollection)this).CopyTo (array, index);
|
||||
}
|
||||
|
||||
protected override ConfigurationElement CreateNewElement ()
|
||||
{
|
||||
return new WsiProfilesElement ();
|
||||
}
|
||||
|
||||
protected override object GetElementKey (ConfigurationElement element)
|
||||
{
|
||||
return ((WsiProfilesElement)element).Name;
|
||||
}
|
||||
|
||||
public int IndexOf (WsiProfilesElement element)
|
||||
{
|
||||
return BaseIndexOf (element);
|
||||
}
|
||||
|
||||
public void Remove (WsiProfilesElement element)
|
||||
{
|
||||
BaseRemove (element.Name);
|
||||
}
|
||||
|
||||
public void RemoveAt (int index)
|
||||
{
|
||||
BaseRemoveAt (index);
|
||||
}
|
||||
|
||||
[MonoTODO ("is this right?")]
|
||||
public void RemoveAt (object key)
|
||||
{
|
||||
BaseRemove (key);
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public WsiProfilesElement this [int index] {
|
||||
get { return (WsiProfilesElement)BaseGet (index); }
|
||||
set { if (BaseGet (index) != null) BaseRemoveAt (index); BaseAdd (index, value); }
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public WsiProfilesElement this [object key] {
|
||||
get { return (WsiProfilesElement)BaseGet (key); }
|
||||
set {
|
||||
WsiProfilesElement el = (WsiProfilesElement)BaseGet (key);
|
||||
if (el == null) {
|
||||
BaseAdd (value);
|
||||
return;
|
||||
}
|
||||
int index = IndexOf (el);
|
||||
BaseRemoveAt (index);
|
||||
BaseAdd (index, value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user