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,133 @@
//
// AddressHeaderCollectionElement.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (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.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Configuration;
using System.Net;
using System.Net.Security;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;
using System.IdentityModel.Claims;
using System.IdentityModel.Policy;
using System.IdentityModel.Tokens;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Diagnostics;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.MsmqIntegration;
using System.ServiceModel.PeerResolvers;
using System.ServiceModel.Security;
using System.Runtime.Serialization;
using System.Text;
using System.Xml;
namespace System.ServiceModel.Configuration
{
public sealed class AddressHeaderCollectionElement
: ConfigurationElement
{
AddressHeaderCollection _headers;
// Properties
[ConfigurationProperty ("headers",
DefaultValue = null,
Options = ConfigurationPropertyOptions.None)]
public AddressHeaderCollection Headers {
get { return _headers; }
set { _headers = value; }
}
protected override ConfigurationPropertyCollection Properties {
get { return base.Properties; }
}
protected override void DeserializeElement (
XmlReader reader, bool serializeCollectionKey) {
reader.MoveToContent ();
_headers = new AddressHeaderCollection (DeserializeAddressHeaders (reader));
}
static IEnumerable<AddressHeader> DeserializeAddressHeaders (XmlReader reader) {
while (true) {
do {
reader.Read ();
} while (reader.NodeType == XmlNodeType.Whitespace);
if (reader.NodeType == XmlNodeType.EndElement)
yield break;
if (reader.NodeType != XmlNodeType.Element)
throw new ConfigurationErrorsException ("invalid node type.");
yield return new ConfiguredAddressHeader (reader.LocalName, reader.NamespaceURI, reader.ReadOuterXml ());
}
}
[MonoTODO]
protected override bool SerializeToXmlElement (
XmlWriter writer, string elementName)
{
return true;
throw new NotImplementedException ();
}
class ConfiguredAddressHeader : AddressHeader {
readonly string _name;
readonly string _namespace;
readonly string _outerXml;
public ConfiguredAddressHeader (string name, string @namespace, string outerXml) {
_name = name;
_namespace = @namespace;
_outerXml = outerXml;
}
[MonoTODO]
protected override void OnWriteAddressHeaderContents (XmlDictionaryWriter writer) {
throw new NotImplementedException ();
}
public override string Name {
get { return _name; }
}
public override string Namespace {
get { return _namespace; }
}
}
}
}

View File

@ -0,0 +1,61 @@
//
// AllowedAudienceUriElement.cs
//
// Author:
// Igor Zelmanovich <igorz@mainsoft.com>
//
// Copyright (C) 2008 Mainsoft, Inc. http://www.mainsoft.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.Generic;
using System.Text;
using System.Configuration;
namespace System.ServiceModel.Configuration
{
public sealed class AllowedAudienceUriElement : ConfigurationElement
{
ConfigurationPropertyCollection _properties;
public AllowedAudienceUriElement () {
}
[StringValidator (MinLength = 1)]
[ConfigurationProperty ("allowedAudienceUri",
Options = ConfigurationPropertyOptions.IsKey)]
public string AllowedAudienceUri {
get { return (string) this ["allowedAudienceUri"]; }
set { this ["allowedAudienceUri"] = value; }
}
protected override ConfigurationPropertyCollection Properties {
get {
if (_properties == null) {
_properties = new ConfigurationPropertyCollection ();
_properties.Add (new ConfigurationProperty ("allowedAudienceUri", typeof (string), null, null, new StringValidator (1), ConfigurationPropertyOptions.IsKey));
}
return _properties;
}
}
}
}

View File

@ -0,0 +1,56 @@
//
// AllowedAudienceUriElementCollection.cs
//
// Author:
// Igor Zelmanovich <igorz@mainsoft.com>
//
// Copyright (C) 2008 Mainsoft, Inc. http://www.mainsoft.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.Generic;
using System.Text;
using System.Configuration;
namespace System.ServiceModel.Configuration
{
[ConfigurationCollection (typeof (AllowedAudienceUriElement), CollectionType = ConfigurationElementCollectionType.BasicMap)]
public sealed class AllowedAudienceUriElementCollection : ServiceModelConfigurationElementCollection<AllowedAudienceUriElement>
{
public AllowedAudienceUriElementCollection () {
}
protected override bool ThrowOnDuplicate {
get {
return base.ThrowOnDuplicate;
}
}
protected override System.Configuration.ConfigurationElement CreateNewElement () {
return new AllowedAudienceUriElement ();
}
protected override object GetElementKey (ConfigurationElement element) {
return ((AllowedAudienceUriElement) element).AllowedAudienceUri;
}
}
}

View File

@ -0,0 +1,53 @@
//
// AuthenticationMode.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.
//
namespace System.ServiceModel.Configuration
{
public enum AuthenticationMode
{
AnonymousForCertificate,
AnonymousForSslNegotiated,
CertificateOverTransport,
IssuedToken,
IssuedTokenForCertificate,
IssuedTokenForSslNegotiated,
IssuedTokenOverTransport,
Kerberos,
KerberosOverTransport,
MutualCertificate,
MutualCertificateDuplex,
MutualSslNegotiated,
SecureConversation,
SspiNegotiated,
UserNameForCertificate,
UserNameForSslNegotiated,
UserNameOverTransport,
SspiNegotiatedOverTransport,
}
}

View File

@ -0,0 +1,107 @@
//
// AuthorizationPolicyTypeElement.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (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.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Configuration;
using System.Net;
using System.Net.Security;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;
using System.IdentityModel.Claims;
using System.IdentityModel.Policy;
using System.IdentityModel.Tokens;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Diagnostics;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.MsmqIntegration;
using System.ServiceModel.PeerResolvers;
using System.ServiceModel.Security;
using System.Runtime.Serialization;
using System.Text;
using System.Xml;
namespace System.ServiceModel.Configuration
{
public sealed class AuthorizationPolicyTypeElement
: ConfigurationElement
{
// Static Fields
static ConfigurationPropertyCollection properties;
static ConfigurationProperty policy_type;
static AuthorizationPolicyTypeElement ()
{
properties = new ConfigurationPropertyCollection ();
policy_type = new ConfigurationProperty ("policyType",
typeof (string), null, null, new StringValidator (1, int.MaxValue),
ConfigurationPropertyOptions.IsRequired| ConfigurationPropertyOptions.IsKey);
properties.Add (policy_type);
}
public AuthorizationPolicyTypeElement ()
{
}
public AuthorizationPolicyTypeElement (string policyType) {
if (policyType == null)
throw new ArgumentNullException ("policyType");
PolicyType = policyType;
}
// Properties
[StringValidator ( MinLength = 1,
MaxLength = int.MaxValue,
InvalidCharacters = null)]
[ConfigurationProperty ("policyType",
Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey,
IsRequired = true,
IsKey = true)]
public string PolicyType {
get { return (string) base [policy_type]; }
set { base [policy_type] = value; }
}
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
}
}

View File

@ -0,0 +1,71 @@
//
// AuthorizationPolicyTypeElementCollection.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (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.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Configuration;
using System.Net;
using System.Net.Security;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;
using System.IdentityModel.Claims;
using System.IdentityModel.Policy;
using System.IdentityModel.Tokens;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Diagnostics;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.MsmqIntegration;
using System.ServiceModel.PeerResolvers;
using System.ServiceModel.Security;
using System.Runtime.Serialization;
using System.Text;
using System.Xml;
namespace System.ServiceModel.Configuration
{
[ConfigurationCollection (typeof (AuthorizationPolicyTypeElement),
AddItemName = "add",
RemoveItemName = "remove",
ClearItemsName = "clear",
CollectionType = ConfigurationElementCollectionType.AddRemoveClearMap)]
public sealed class AuthorizationPolicyTypeElementCollection
: ServiceModelConfigurationElementCollection<AuthorizationPolicyTypeElement>, ICollection, IEnumerable
{
// Properties
protected override object GetElementKey (ConfigurationElement element) {
return ((AuthorizationPolicyTypeElement) element).PolicyType;
}
}
}

View File

@ -0,0 +1,100 @@
//
// BaseAddressElement.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (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.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Configuration;
using System.Net;
using System.Net.Security;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;
using System.IdentityModel.Claims;
using System.IdentityModel.Policy;
using System.IdentityModel.Tokens;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Diagnostics;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.MsmqIntegration;
using System.ServiceModel.PeerResolvers;
using System.ServiceModel.Security;
using System.Runtime.Serialization;
using System.Text;
using System.Xml;
namespace System.ServiceModel.Configuration
{
public sealed class BaseAddressElement
: ConfigurationElement
{
// Static Fields
static ConfigurationPropertyCollection properties;
static ConfigurationProperty base_address;
static BaseAddressElement ()
{
properties = new ConfigurationPropertyCollection ();
base_address = new ConfigurationProperty ("baseAddress",
typeof (string), null, new StringConverter (), new StringValidator (1, int.MaxValue, null),
ConfigurationPropertyOptions.IsRequired| ConfigurationPropertyOptions.IsKey);
properties.Add (base_address);
}
public BaseAddressElement ()
{
}
// Properties
[ConfigurationProperty ("baseAddress",
Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey,
IsRequired = true,
IsKey = true)]
[StringValidator ( MinLength = 1,
MaxLength = int.MaxValue,
InvalidCharacters = null)]
public string BaseAddress {
get { return (string) base [base_address]; }
set { base [base_address] = value; }
}
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
}
}

View File

@ -0,0 +1,79 @@
//
// BaseAddressElementCollection.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (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.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Configuration;
using System.Net;
using System.Net.Security;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;
using System.IdentityModel.Claims;
using System.IdentityModel.Policy;
using System.IdentityModel.Tokens;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Diagnostics;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.MsmqIntegration;
using System.ServiceModel.PeerResolvers;
using System.ServiceModel.Security;
using System.Runtime.Serialization;
using System.Text;
using System.Xml;
namespace System.ServiceModel.Configuration
{
[ConfigurationCollection (typeof (BaseAddressElement),
AddItemName = "add",
RemoveItemName = "remove",
ClearItemsName = "clear",
CollectionType = ConfigurationElementCollectionType.BasicMap)]
public sealed class BaseAddressElementCollection
: ServiceModelConfigurationElementCollection<BaseAddressElement>, ICollection, IEnumerable
{
protected override object GetElementKey (ConfigurationElement element) {
return ((BaseAddressElement) element).BaseAddress;
}
protected override ConfigurationElement CreateNewElement ()
{
return new BaseAddressElement ();
}
protected override bool ThrowOnDuplicate {
get { return false; }
}
}
}

View File

@ -0,0 +1,102 @@
//
// BaseAddressPrefixFilterElement.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.
//
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Configuration;
using System.Net;
using System.Net.Security;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;
using System.IdentityModel.Claims;
using System.IdentityModel.Policy;
using System.IdentityModel.Tokens;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Diagnostics;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.MsmqIntegration;
using System.ServiceModel.PeerResolvers;
using System.ServiceModel.Security;
using System.Runtime.Serialization;
using System.Text;
using System.Xml;
namespace System.ServiceModel.Configuration
{
public sealed class BaseAddressPrefixFilterElement
: ConfigurationElement
{
// Static Fields
static ConfigurationPropertyCollection properties;
static ConfigurationProperty prefix;
static BaseAddressPrefixFilterElement ()
{
properties = new ConfigurationPropertyCollection ();
prefix = new ConfigurationProperty ("prefix",
typeof (Uri), null, new UriTypeConverter (), new StringValidator (1, int.MaxValue, null),
ConfigurationPropertyOptions.IsRequired| ConfigurationPropertyOptions.IsKey);
properties.Add (prefix);
}
public BaseAddressPrefixFilterElement ()
{
}
public BaseAddressPrefixFilterElement (Uri prefix)
{
Prefix = prefix;
}
// Properties
[ConfigurationProperty ("prefix",
Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey,
IsRequired = true,
IsKey = true)]
public Uri Prefix {
get { return (Uri) base [prefix]; }
set { base [prefix] = value; }
}
protected override ConfigurationPropertyCollection Properties {
get { return properties; }
}
}
}

View File

@ -0,0 +1,79 @@
//
// BaseAddressPrefixFilterElementCollection.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.
//
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Configuration;
using System.Net;
using System.Net.Security;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;
using System.IdentityModel.Claims;
using System.IdentityModel.Policy;
using System.IdentityModel.Tokens;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Diagnostics;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.MsmqIntegration;
using System.ServiceModel.PeerResolvers;
using System.ServiceModel.Security;
using System.Runtime.Serialization;
using System.Text;
using System.Xml;
namespace System.ServiceModel.Configuration
{
[ConfigurationCollection (typeof (BaseAddressPrefixFilterElement),
AddItemName = "add",
RemoveItemName = "remove",
ClearItemsName = "clear",
CollectionType = ConfigurationElementCollectionType.BasicMap)]
public sealed class BaseAddressPrefixFilterElementCollection
: ServiceModelConfigurationElementCollection<BaseAddressPrefixFilterElement>, ICollection, IEnumerable
{
protected override object GetElementKey (ConfigurationElement element) {
return ((BaseAddressPrefixFilterElement) element).Prefix;
}
protected override ConfigurationElement CreateNewElement ()
{
return new BaseAddressPrefixFilterElement ();
}
protected override bool ThrowOnDuplicate {
get { return false; }
}
}
}

View File

@ -0,0 +1,62 @@
//
// BasicHttpBindingCollectionElement.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (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.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Configuration;
using System.Net;
using System.Net.Security;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;
using System.IdentityModel.Claims;
using System.IdentityModel.Policy;
using System.IdentityModel.Tokens;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Diagnostics;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.MsmqIntegration;
using System.ServiceModel.PeerResolvers;
using System.ServiceModel.Security;
using System.Runtime.Serialization;
using System.Text;
using System.Xml;
namespace System.ServiceModel.Configuration
{
public partial class BasicHttpBindingCollectionElement
: StandardBindingCollectionElement<BasicHttpBinding, BasicHttpBindingElement>
{
}
}

View File

@ -0,0 +1,259 @@
//
// BasicHttpBindingElement.cs
//
// See BasicHttpBindingElement_4_5.cs and HttpBindingBaseElement.cs
// for the .NET 4.5 version of this class, where most of the code has
// been moved into the new abstract HttpBindingBaseElement class.
//
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (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.
//
#if !NET_4_5
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Configuration;
using System.Net;
using System.Net.Security;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;
using System.IdentityModel.Claims;
using System.IdentityModel.Policy;
using System.IdentityModel.Tokens;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Diagnostics;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.MsmqIntegration;
using System.ServiceModel.PeerResolvers;
using System.ServiceModel.Security;
using System.Runtime.Serialization;
using System.Text;
using System.Xml;
namespace System.ServiceModel.Configuration
{
public class BasicHttpBindingElement
: StandardBindingElement, IBindingConfigurationElement
{
ConfigurationPropertyCollection _properties;
public BasicHttpBindingElement ()
{
}
public BasicHttpBindingElement (string name) : base (name) { }
// Properties
[ConfigurationProperty ("allowCookies",
DefaultValue = false,
Options = ConfigurationPropertyOptions.None)]
public bool AllowCookies {
get { return (bool) this ["allowCookies"]; }
set { this ["allowCookies"] = value; }
}
protected override Type BindingElementType {
get { return typeof (BasicHttpBinding); }
}
[ConfigurationProperty ("bypassProxyOnLocal",
DefaultValue = false,
Options = ConfigurationPropertyOptions.None)]
public bool BypassProxyOnLocal {
get { return (bool) this ["bypassProxyOnLocal"]; }
set { this ["bypassProxyOnLocal"] = value; }
}
[ConfigurationProperty ("hostNameComparisonMode",
DefaultValue = "StrongWildcard",
Options = ConfigurationPropertyOptions.None)]
public HostNameComparisonMode HostNameComparisonMode {
get { return (HostNameComparisonMode) this ["hostNameComparisonMode"]; }
set { this ["hostNameComparisonMode"] = value; }
}
[LongValidator ( MinValue = 0,
MaxValue = 9223372036854775807,
ExcludeRange = false)]
[ConfigurationProperty ("maxBufferPoolSize",
DefaultValue = "524288",
Options = ConfigurationPropertyOptions.None)]
public long MaxBufferPoolSize {
get { return (long) this ["maxBufferPoolSize"]; }
set { this ["maxBufferPoolSize"] = value; }
}
[IntegerValidator ( MinValue = 1,
MaxValue = int.MaxValue,
ExcludeRange = false)]
[ConfigurationProperty ("maxBufferSize",
DefaultValue = "65536",
Options = ConfigurationPropertyOptions.None)]
public int MaxBufferSize {
get { return (int) this ["maxBufferSize"]; }
set { this ["maxBufferSize"] = value; }
}
[LongValidator ( MinValue = 1,
MaxValue = 9223372036854775807,
ExcludeRange = false)]
[ConfigurationProperty ("maxReceivedMessageSize",
DefaultValue = "65536",
Options = ConfigurationPropertyOptions.None)]
public long MaxReceivedMessageSize {
get { return (long) this ["maxReceivedMessageSize"]; }
set { this ["maxReceivedMessageSize"] = value; }
}
[ConfigurationProperty ("messageEncoding",
DefaultValue = "Text",
Options = ConfigurationPropertyOptions.None)]
public WSMessageEncoding MessageEncoding {
get { return (WSMessageEncoding) this ["messageEncoding"]; }
set { this ["messageEncoding"] = value; }
}
protected override ConfigurationPropertyCollection Properties {
get {
if (_properties == null) {
_properties = base.Properties;
_properties.Add (new ConfigurationProperty ("allowCookies", typeof (bool), "false", null, null, ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("bypassProxyOnLocal", typeof (bool), "false", null, null, ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("hostNameComparisonMode", typeof (HostNameComparisonMode), "StrongWildcard", null, null, ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("maxBufferPoolSize", typeof (long), "524288", null, new LongValidator (0, 9223372036854775807, false), ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("maxBufferSize", typeof (int), "65536", null, new IntegerValidator (1, int.MaxValue, false), ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("maxReceivedMessageSize", typeof (long), "65536", null, new LongValidator (1, 9223372036854775807, false), ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("messageEncoding", typeof (WSMessageEncoding), "Text", null, null, ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("proxyAddress", typeof (Uri), null, new UriTypeConverter (), null, ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("readerQuotas", typeof (XmlDictionaryReaderQuotasElement), null, null, null, ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("security", typeof (BasicHttpSecurityElement), null, null, null, ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("textEncoding", typeof (Encoding), BasicHttpBinding.DefaultTextEncoding, EncodingConverter.Instance, null, ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("transferMode", typeof (TransferMode), "Buffered", null, null, ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("useDefaultWebProxy", typeof (bool), "true", new BooleanConverter (), null, ConfigurationPropertyOptions.None));
}
return _properties;
}
}
[ConfigurationProperty ("proxyAddress",
DefaultValue = null,
Options = ConfigurationPropertyOptions.None)]
public Uri ProxyAddress {
get { return (Uri) this ["proxyAddress"]; }
set { this ["proxyAddress"] = value; }
}
[ConfigurationProperty ("readerQuotas",
Options = ConfigurationPropertyOptions.None)]
public XmlDictionaryReaderQuotasElement ReaderQuotas {
get { return (XmlDictionaryReaderQuotasElement) this ["readerQuotas"]; }
}
[ConfigurationProperty ("security",
Options = ConfigurationPropertyOptions.None)]
public BasicHttpSecurityElement Security {
get { return (BasicHttpSecurityElement) this ["security"]; }
}
[TypeConverter (typeof (EncodingConverter))]
[ConfigurationProperty ("textEncoding",
DefaultValue = "utf-8",
Options = ConfigurationPropertyOptions.None)]
public Encoding TextEncoding {
get { return (Encoding) this ["textEncoding"]; }
set { this ["textEncoding"] = value; }
}
[ConfigurationProperty ("transferMode",
DefaultValue = "Buffered",
Options = ConfigurationPropertyOptions.None)]
public TransferMode TransferMode {
get { return (TransferMode) this ["transferMode"]; }
set { this ["transferMode"] = value; }
}
[ConfigurationProperty ("useDefaultWebProxy",
DefaultValue = true,
Options = ConfigurationPropertyOptions.None)]
public bool UseDefaultWebProxy {
get { return (bool) this ["useDefaultWebProxy"]; }
set { this ["useDefaultWebProxy"] = value; }
}
protected override void OnApplyConfiguration (Binding binding)
{
BasicHttpBinding basicHttpBinding = (BasicHttpBinding) binding;
basicHttpBinding.AllowCookies = AllowCookies;
basicHttpBinding.BypassProxyOnLocal = BypassProxyOnLocal;
basicHttpBinding.HostNameComparisonMode = HostNameComparisonMode;
basicHttpBinding.MaxBufferPoolSize = MaxBufferPoolSize;
basicHttpBinding.MaxBufferSize = MaxBufferSize;
basicHttpBinding.MaxReceivedMessageSize = MaxReceivedMessageSize;
basicHttpBinding.MessageEncoding = MessageEncoding;
basicHttpBinding.ProxyAddress = ProxyAddress;
ReaderQuotas.ApplyConfiguration (basicHttpBinding.ReaderQuotas);
basicHttpBinding.Security.Mode = Security.Mode;
Security.Transport.ApplyConfiguration (basicHttpBinding.Security.Transport);
basicHttpBinding.TextEncoding = TextEncoding;
basicHttpBinding.TransferMode = TransferMode;
basicHttpBinding.UseDefaultWebProxy = UseDefaultWebProxy;
}
protected internal override void InitializeFrom (Binding binding)
{
BasicHttpBinding b = (BasicHttpBinding) binding;
base.InitializeFrom (binding);
AllowCookies = b.AllowCookies;
BypassProxyOnLocal = b.BypassProxyOnLocal;
HostNameComparisonMode = b.HostNameComparisonMode;
MaxBufferPoolSize = b.MaxBufferPoolSize;
MaxBufferSize = b.MaxBufferSize;
MaxReceivedMessageSize = b.MaxReceivedMessageSize;
MessageEncoding = b.MessageEncoding;
ProxyAddress = b.ProxyAddress;
ReaderQuotas.ApplyConfiguration (b.ReaderQuotas);
Security.Mode = b.Security.Mode;
Security.Transport.ApplyConfiguration (b.Security.Transport);
TextEncoding = b.TextEncoding;
TransferMode = b.TransferMode;
UseDefaultWebProxy = b.UseDefaultWebProxy;
}
}
}
#endif

View File

@ -0,0 +1,123 @@
//
// BasicHttpBindingElement_4_5.cs
//
// Authors:
// Atsushi Enomoto <atsushi@ximian.com>
// Martin Baulig <martin.baulig@xamarin.com>
//
// Copyright (C) 2006 Novell, Inc. http://www.novell.com
// Copyright (c) 2012 Xamarin Inc. (http://www.xamarin.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.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Configuration;
using System.Net;
using System.Net.Security;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;
using System.IdentityModel.Claims;
using System.IdentityModel.Policy;
using System.IdentityModel.Tokens;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Diagnostics;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.MsmqIntegration;
using System.ServiceModel.PeerResolvers;
using System.ServiceModel.Security;
using System.Runtime.Serialization;
using System.Text;
using System.Xml;
namespace System.ServiceModel.Configuration
{
public class BasicHttpBindingElement
: HttpBindingBaseElement, IBindingConfigurationElement
{
ConfigurationPropertyCollection _properties;
public BasicHttpBindingElement ()
{
}
public BasicHttpBindingElement (string name) : base (name) { }
protected override Type BindingElementType {
get { return typeof (BasicHttpBinding); }
}
// Properties
[ConfigurationProperty ("messageEncoding",
DefaultValue = "Text",
Options = ConfigurationPropertyOptions.None)]
public WSMessageEncoding MessageEncoding {
get { return (WSMessageEncoding) this ["messageEncoding"]; }
set { this ["messageEncoding"] = value; }
}
protected override ConfigurationPropertyCollection Properties {
get {
if (_properties == null) {
_properties = base.Properties;
_properties.Add (new ConfigurationProperty ("messageEncoding", typeof (WSMessageEncoding), "Text", null, null, ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("security", typeof (BasicHttpSecurityElement), null, null, null, ConfigurationPropertyOptions.None));
}
return _properties;
}
}
[ConfigurationProperty ("security",
Options = ConfigurationPropertyOptions.None)]
public BasicHttpSecurityElement Security {
get { return (BasicHttpSecurityElement) this ["security"]; }
}
protected override void OnApplyConfiguration (Binding binding)
{
base.OnApplyConfiguration (binding);
BasicHttpBinding basicHttpBinding = (BasicHttpBinding) binding;
basicHttpBinding.MessageEncoding = MessageEncoding;
basicHttpBinding.Security.Mode = Security.Mode;
Security.Transport.ApplyConfiguration (basicHttpBinding.Security.Transport);
}
protected internal override void InitializeFrom (Binding binding)
{
BasicHttpBinding b = (BasicHttpBinding) binding;
base.InitializeFrom (binding);
MessageEncoding = b.MessageEncoding;
Security.Mode = b.Security.Mode;
Security.Transport.ApplyConfiguration (b.Security.Transport);
}
}
}

View File

@ -0,0 +1,86 @@
//
// BasicHttpMessageSecurityElement.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (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.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Configuration;
using System.Net;
using System.Net.Security;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;
using System.IdentityModel.Claims;
using System.IdentityModel.Policy;
using System.IdentityModel.Tokens;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Diagnostics;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.MsmqIntegration;
using System.ServiceModel.PeerResolvers;
using System.ServiceModel.Security;
using System.Runtime.Serialization;
using System.Text;
using System.Xml;
namespace System.ServiceModel.Configuration
{
public sealed class BasicHttpMessageSecurityElement
: ConfigurationElement
{
// Properties
[ConfigurationProperty ("algorithmSuite",
DefaultValue = "Default",
Options = ConfigurationPropertyOptions.None)]
[TypeConverter (typeof (SecurityAlgorithmSuiteConverter))]
public SecurityAlgorithmSuite AlgorithmSuite {
get { return (SecurityAlgorithmSuite) base ["algorithmSuite"]; }
set { base ["algorithmSuite"] = value; }
}
[ConfigurationProperty ("clientCredentialType",
DefaultValue = "UserName",
Options = ConfigurationPropertyOptions.None)]
public BasicHttpMessageCredentialType ClientCredentialType {
get { return (BasicHttpMessageCredentialType) base ["clientCredentialType"]; }
set { base ["clientCredentialType"] = value; }
}
protected override ConfigurationPropertyCollection Properties {
get { return base.Properties; }
}
}
}

View File

@ -0,0 +1,89 @@
//
// BasicHttpSecurityElement.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (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.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Configuration;
using System.Net;
using System.Net.Security;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;
using System.IdentityModel.Claims;
using System.IdentityModel.Policy;
using System.IdentityModel.Tokens;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Diagnostics;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.MsmqIntegration;
using System.ServiceModel.PeerResolvers;
using System.ServiceModel.Security;
using System.Runtime.Serialization;
using System.Text;
using System.Xml;
namespace System.ServiceModel.Configuration
{
public sealed class BasicHttpSecurityElement
: ConfigurationElement
{
// Properties
[ConfigurationProperty ("message",
Options = ConfigurationPropertyOptions.None)]
public BasicHttpMessageSecurityElement Message {
get { return (BasicHttpMessageSecurityElement) base ["message"]; }
}
[ConfigurationProperty ("mode",
DefaultValue = "None",
Options = ConfigurationPropertyOptions.None)]
public BasicHttpSecurityMode Mode {
get { return (BasicHttpSecurityMode) base ["mode"]; }
set { base ["mode"] = value; }
}
protected override ConfigurationPropertyCollection Properties {
get { return base.Properties; }
}
[ConfigurationProperty ("transport",
Options = ConfigurationPropertyOptions.None)]
public HttpTransportSecurityElement Transport {
get { return (HttpTransportSecurityElement) base ["transport"]; }
}
}
}

View File

@ -0,0 +1,62 @@
//
// BasicHttpsBindingCollectionElement.cs
//
// Author:
// Martin Baulig <martin.baulig@xamarin.com>
//
// Copyright (c) 2012 Xamarin Inc. (http://www.xamarin.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.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Configuration;
using System.Net;
using System.Net.Security;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;
using System.IdentityModel.Claims;
using System.IdentityModel.Policy;
using System.IdentityModel.Tokens;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Diagnostics;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.MsmqIntegration;
using System.ServiceModel.PeerResolvers;
using System.ServiceModel.Security;
using System.Runtime.Serialization;
using System.Text;
using System.Xml;
namespace System.ServiceModel.Configuration
{
public partial class BasicHttpsBindingCollectionElement
: StandardBindingCollectionElement<BasicHttpsBinding, BasicHttpsBindingElement>
{
}
}

View File

@ -0,0 +1,123 @@
//
// BasicHttpsBindingElement.cs
//
// Authors:
// Atsushi Enomoto <atsushi@ximian.com>
// Martin Baulig <martin.baulig@xamarin.com>
//
// Copyright (C) 2006 Novell, Inc. http://www.novell.com
// Copyright (c) 2012 Xamarin Inc. (http://www.xamarin.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.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Configuration;
using System.Net;
using System.Net.Security;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;
using System.IdentityModel.Claims;
using System.IdentityModel.Policy;
using System.IdentityModel.Tokens;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Diagnostics;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.MsmqIntegration;
using System.ServiceModel.PeerResolvers;
using System.ServiceModel.Security;
using System.Runtime.Serialization;
using System.Text;
using System.Xml;
namespace System.ServiceModel.Configuration
{
public class BasicHttpsBindingElement
: HttpBindingBaseElement, IBindingConfigurationElement
{
ConfigurationPropertyCollection _properties;
public BasicHttpsBindingElement ()
{
}
public BasicHttpsBindingElement (string name) : base (name) { }
protected override Type BindingElementType {
get { return typeof (BasicHttpsBinding); }
}
// Properties
[ConfigurationProperty ("messageEncoding",
DefaultValue = "Text",
Options = ConfigurationPropertyOptions.None)]
public WSMessageEncoding MessageEncoding {
get { return (WSMessageEncoding) this ["messageEncoding"]; }
set { this ["messageEncoding"] = value; }
}
protected override ConfigurationPropertyCollection Properties {
get {
if (_properties == null) {
_properties = base.Properties;
_properties.Add (new ConfigurationProperty ("messageEncoding", typeof (WSMessageEncoding), "Text", null, null, ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("security", typeof (BasicHttpsSecurityElement), null, null, null, ConfigurationPropertyOptions.None));
}
return _properties;
}
}
[ConfigurationProperty ("security",
Options = ConfigurationPropertyOptions.None)]
public BasicHttpsSecurityElement Security {
get { return (BasicHttpsSecurityElement) this ["security"]; }
}
protected override void OnApplyConfiguration (Binding binding)
{
base.OnApplyConfiguration (binding);
BasicHttpsBinding basicHttpsBinding = (BasicHttpsBinding) binding;
basicHttpsBinding.MessageEncoding = MessageEncoding;
basicHttpsBinding.Security.Mode = Security.Mode;
Security.Transport.ApplyConfiguration (basicHttpsBinding.Security.Transport);
}
protected internal override void InitializeFrom (Binding binding)
{
BasicHttpsBinding b = (BasicHttpsBinding) binding;
base.InitializeFrom (binding);
MessageEncoding = b.MessageEncoding;
Security.Mode = b.Security.Mode;
Security.Transport.ApplyConfiguration (b.Security.Transport);
}
}
}

View File

@ -0,0 +1,91 @@
//
// BasicHttpsSecurityElement.cs
//
// Authors:
// Atsushi Enomoto <atsushi@ximian.com>
// Martin Baulig <martin.baulig@xamarin.com>
//
// Copyright (C) 2006 Novell, Inc. http://www.novell.com
// Copyright (c) 2012 Xamarin Inc. (http://www.xamarin.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.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Configuration;
using System.Net;
using System.Net.Security;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;
using System.IdentityModel.Claims;
using System.IdentityModel.Policy;
using System.IdentityModel.Tokens;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Diagnostics;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.MsmqIntegration;
using System.ServiceModel.PeerResolvers;
using System.ServiceModel.Security;
using System.Runtime.Serialization;
using System.Text;
using System.Xml;
namespace System.ServiceModel.Configuration
{
public sealed class BasicHttpsSecurityElement
: ConfigurationElement
{
// Properties
[ConfigurationProperty ("message",
Options = ConfigurationPropertyOptions.None)]
public BasicHttpMessageSecurityElement Message {
get { return (BasicHttpMessageSecurityElement) base ["message"]; }
}
[ConfigurationProperty ("mode",
DefaultValue = "None",
Options = ConfigurationPropertyOptions.None)]
public BasicHttpsSecurityMode Mode {
get { return (BasicHttpsSecurityMode) base ["mode"]; }
set { base ["mode"] = value; }
}
protected override ConfigurationPropertyCollection Properties {
get { return base.Properties; }
}
[ConfigurationProperty ("transport",
Options = ConfigurationPropertyOptions.None)]
public HttpTransportSecurityElement Transport {
get { return (HttpTransportSecurityElement) base ["transport"]; }
}
}
}

View File

@ -0,0 +1,52 @@
//
// BehaviorExtensionElement.cs
//
// Author:
// Igor Zelmanovich <igorz@mainsoft.com>
//
// Copyright (C) 2008 Mainsoft, Inc. http://www.mainsoft.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.Generic;
using System.Text;
using System.Xml;
namespace System.ServiceModel.Configuration
{
// BehaviorExtensionElement
public abstract class BehaviorExtensionElement
: ServiceModelExtensionElement
{
protected BehaviorExtensionElement () {
}
// Properties
public abstract Type BehaviorType { get; }
protected internal abstract object CreateBehavior ();
internal override string GetConfigurationElementName () {
return ConfigUtil.ExtensionsSection.BehaviorExtensions.GetConfigurationElementName (GetType ());
}
}
}

View File

@ -0,0 +1,90 @@
//
// BehaviorsSection.cs
//
// Author:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (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.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Configuration;
using System.Net;
using System.Net.Security;
using System.Reflection;
using System.Security.Cryptography.X509Certificates;
using System.Security.Principal;
using System.IdentityModel.Claims;
using System.IdentityModel.Policy;
using System.IdentityModel.Tokens;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Diagnostics;
using System.ServiceModel.Dispatcher;
using System.ServiceModel.MsmqIntegration;
using System.ServiceModel.PeerResolvers;
using System.ServiceModel.Security;
using System.Runtime.Serialization;
using System.Text;
using System.Xml;
namespace System.ServiceModel.Configuration
{
public class BehaviorsSection
: ConfigurationSection
{
ConfigurationPropertyCollection _properties;
// Properties
[ConfigurationProperty ("endpointBehaviors",
Options = ConfigurationPropertyOptions.None)]
public EndpointBehaviorElementCollection EndpointBehaviors {
get { return (EndpointBehaviorElementCollection) base ["endpointBehaviors"]; }
}
protected override ConfigurationPropertyCollection Properties {
get {
if (_properties == null) {
_properties = new ConfigurationPropertyCollection ();
_properties.Add (new ConfigurationProperty ("endpointBehaviors", typeof (EndpointBehaviorElementCollection), null, null/* FIXME: get converter for EndpointBehaviorElementCollection*/, null, ConfigurationPropertyOptions.None));
_properties.Add (new ConfigurationProperty ("serviceBehaviors", typeof (ServiceBehaviorElementCollection), null, null/* FIXME: get converter for ServiceBehaviorElementCollection*/, null, ConfigurationPropertyOptions.None));
}
return _properties;
}
}
[ConfigurationProperty ("serviceBehaviors",
Options = ConfigurationPropertyOptions.None)]
public ServiceBehaviorElementCollection ServiceBehaviors {
get { return (ServiceBehaviorElementCollection) base ["serviceBehaviors"]; }
}
}
}

Some files were not shown because too many files have changed in this diff Show More