mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 01:41:18 -10:00
[WCF]: Add stubs for some missing .NET 4.0/4.5 APIs.
This commit is contained in:
1 parent
4db812ca7e
commit
1ae87e9ee9
16 files changed
+170
-2
No files matched your search
+11
@@ -82,6 +82,9 @@ namespace System.ServiceModel.Channels
|
||||
|
||||
public XmlDictionaryReaderQuotas ReaderQuotas {
|
||||
get { return quotas; }
|
||||
#if NET_4_0
|
||||
set { quotas = value; }
|
||||
#endif
|
||||
}
|
||||
|
||||
public override IChannelFactory<TChannel> BuildChannelFactory<TChannel> (
|
||||
@@ -152,5 +155,13 @@ namespace System.ServiceModel.Channels
|
||||
assertions.Add (doc.CreateElement ("msb", "BinaryEncoding", "http://schemas.microsoft.com/ws/06/2004/mspolicy/netbinary1"));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if NET_4_5
|
||||
[MonoTODO]
|
||||
public CompressionFormat CompressionFormat {
|
||||
get { throw new NotImplementedException (); }
|
||||
set { throw new NotImplementedException (); }
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// CompressionFormat.cs
|
||||
//
|
||||
// Author:
|
||||
// Martin Baulig <[email protected]>
|
||||
//
|
||||
// Copyright (c) 2013 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.
|
||||
|
||||
namespace System.ServiceModel.Channels
|
||||
{
|
||||
public enum CompressionFormat {
|
||||
None,
|
||||
GZip,
|
||||
Deflate
|
||||
}
|
||||
}
|
||||
@@ -94,6 +94,24 @@ namespace System.ServiceModel.Channels
|
||||
Close ();
|
||||
}
|
||||
|
||||
#if NET_4_5
|
||||
public T GetBody<T> ()
|
||||
{
|
||||
return OnGetBody<T> (GetReaderAtBodyContents ());
|
||||
}
|
||||
|
||||
public T GetBody<T> (XmlObjectSerializer xmlFormatter)
|
||||
{
|
||||
// FIXME: Somehow use OnGetBody() here as well?
|
||||
return (T)xmlFormatter.ReadObject (GetReaderAtBodyContents ());
|
||||
}
|
||||
|
||||
protected virtual T OnGetBody<T> (XmlDictionaryReader reader)
|
||||
{
|
||||
var xmlFormatter = new DataContractSerializer (typeof (T));
|
||||
return (T)xmlFormatter.ReadObject (reader);
|
||||
}
|
||||
#else
|
||||
public T GetBody<T> ()
|
||||
{
|
||||
return GetBody<T> (new DataContractSerializer (typeof (T)));
|
||||
@@ -103,6 +121,7 @@ namespace System.ServiceModel.Channels
|
||||
{
|
||||
return (T) xmlFormatter.ReadObject (GetReaderAtBodyContents ());
|
||||
}
|
||||
#endif
|
||||
|
||||
public string GetBodyAttribute (string localName, string ns)
|
||||
{
|
||||
|
||||
+3
@@ -88,6 +88,9 @@ namespace System.ServiceModel.Channels
|
||||
|
||||
public XmlDictionaryReaderQuotas ReaderQuotas {
|
||||
get { return quotas; }
|
||||
#if NET_4_0
|
||||
set { quotas = value; }
|
||||
#endif
|
||||
}
|
||||
|
||||
public Encoding WriteEncoding {
|
||||
|
||||
+2
-2
@@ -35,10 +35,10 @@ namespace System.ServiceModel.Channels {
|
||||
}
|
||||
|
||||
public const string BinaryEncoderTransferModeHeader = null;
|
||||
public const string BinaryMessageReceivedAction = null;
|
||||
public const string BinaryMessageReceivedAction = "http://schemas.microsoft.com/2011/02/websockets/onbinarymessage";
|
||||
public const string ConnectionOpenedAction = null;
|
||||
public const string SoapContentTypeHeader = null;
|
||||
public const string TextMessageReceivedAction = null;
|
||||
public const string TextMessageReceivedAction = "http://schemas.microsoft.com/2011/02/websockets/ontextmessage";
|
||||
|
||||
public bool CreateNotificationOnConnection { get; set; }
|
||||
public bool DisablePayloadMasking { get; set; }
|
||||
|
||||
@@ -122,6 +122,13 @@ namespace System.ServiceModel.Description
|
||||
get { return behaviors; }
|
||||
}
|
||||
|
||||
#if NET_4_5
|
||||
[MonoTODO]
|
||||
public KeyedCollection<Type,IContractBehavior> ContractBehaviors {
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
#endif
|
||||
|
||||
public Type CallbackContractType {
|
||||
get { return callback_contract_type; }
|
||||
set { callback_contract_type = value; }
|
||||
|
||||
@@ -74,6 +74,19 @@ namespace System.ServiceModel.Description
|
||||
get { return behaviors; }
|
||||
}
|
||||
|
||||
#if NET_4_5
|
||||
[MonoTODO]
|
||||
public KeyedCollection<Type,IOperationBehavior> OperationBehaviors {
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public MethodInfo TaskMethod {
|
||||
get { throw new NotImplementedException (); }
|
||||
set { throw new NotImplementedException (); }
|
||||
}
|
||||
#endif
|
||||
|
||||
public ContractDescription DeclaringContract {
|
||||
get { return contract; }
|
||||
set { contract = value; }
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
//
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
#if NET_4_5
|
||||
using System.Collections.ObjectModel;
|
||||
#endif
|
||||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.ServiceModel.Channels;
|
||||
@@ -67,6 +70,13 @@ namespace System.ServiceModel.Description
|
||||
get { return behaviors; }
|
||||
}
|
||||
|
||||
#if NET_4_5
|
||||
[MonoTODO]
|
||||
public KeyedCollection<Type,IEndpointBehavior> EndpointBehaviors {
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
#endif
|
||||
|
||||
public ContractDescription Contract {
|
||||
get { return contract; }
|
||||
#if NET_4_0
|
||||
|
||||
@@ -185,6 +185,25 @@ namespace System.ServiceModel.Dispatcher
|
||||
}
|
||||
throw new InvalidOperationException ("Cannot change this property after the service host is opened");
|
||||
}
|
||||
|
||||
#if NET_4_5
|
||||
[MonoTODO]
|
||||
public ICollection<IParameterInspector> ClientParameterInspectors {
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public MethodInfo TaskMethod {
|
||||
get { throw new NotImplementedException (); }
|
||||
set { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public Type TaskTResult {
|
||||
get { throw new NotImplementedException (); }
|
||||
set { throw new NotImplementedException (); }
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
@@ -98,6 +98,18 @@ namespace System.ServiceModel.Dispatcher
|
||||
}
|
||||
#endif
|
||||
|
||||
#if NET_4_5
|
||||
[MonoTODO]
|
||||
public ICollection<ClientOperation> ClientOperations {
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public ICollection<IClientMessageInspector> ClientMessageInspectors {
|
||||
get { throw new NotImplementedException (); }
|
||||
}
|
||||
#endif
|
||||
|
||||
public bool ManualAddressing {
|
||||
get { return manual_addressing; }
|
||||
set { manual_addressing = value; }
|
||||
|
||||
@@ -241,6 +241,9 @@ namespace System.ServiceModel // used to be S.SM.Ch
|
||||
Ntlm,
|
||||
Windows,
|
||||
Certificate,
|
||||
#if NET_4_5
|
||||
InheritedFromHost
|
||||
#endif
|
||||
}
|
||||
|
||||
public enum HttpProxyCredentialType
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
using System;
|
||||
using System.Threading;
|
||||
using System.Collections.Generic;
|
||||
using System.ServiceModel.Channels;
|
||||
using System.ServiceModel.Dispatcher;
|
||||
@@ -235,5 +236,13 @@ namespace System.ServiceModel
|
||||
protected override void OnClose (TimeSpan timeout)
|
||||
{
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
[MonoTODO]
|
||||
public SynchronizationContext SynchronizationContext {
|
||||
get { throw new NotImplementedException (); }
|
||||
set { throw new NotImplementedException (); }
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,9 @@ using System.ServiceModel.Channels;
|
||||
using System.ServiceModel.Description;
|
||||
using System.ServiceModel.Security;
|
||||
using System.ServiceModel.Security.Tokens;
|
||||
#if NET_4_0
|
||||
using System.ServiceModel.Configuration;
|
||||
#endif
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
|
||||
@@ -64,6 +67,16 @@ namespace System.ServiceModel
|
||||
transport = new TcpTransportBindingElement ();
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
public NetTcpBinding (string configurationName)
|
||||
: this ()
|
||||
{
|
||||
var bindingsSection = ConfigUtil.BindingsSection;
|
||||
var el = bindingsSection.NetTcpBinding.Bindings [configurationName];
|
||||
el.ApplyConfiguration (this);
|
||||
}
|
||||
#endif
|
||||
|
||||
internal NetTcpBinding (TcpTransportBindingElement transport,
|
||||
NetTcpSecurity security,
|
||||
bool reliableSessionEnabled)
|
||||
|
||||
@@ -53,6 +53,9 @@ namespace System.ServiceModel
|
||||
|
||||
public MessageSecurityOverTcp Message {
|
||||
get { return message; }
|
||||
#if NET_4_0
|
||||
set { message = value; }
|
||||
#endif
|
||||
}
|
||||
|
||||
public SecurityMode Mode {
|
||||
@@ -62,6 +65,9 @@ namespace System.ServiceModel
|
||||
|
||||
public TcpTransportSecurity Transport {
|
||||
get { return transport; }
|
||||
#if NET_4_0
|
||||
set { transport = value; }
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,5 +46,13 @@ namespace System.ServiceModel
|
||||
: this (Claim.CreateSpnClaim (spn))
|
||||
{
|
||||
}
|
||||
|
||||
#if NET_4_0
|
||||
[MonoTODO]
|
||||
public static TimeSpan SpnLookupTime {
|
||||
get { throw new NotImplementedException (); }
|
||||
set { throw new NotImplementedException (); }
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ System.ServiceModel/BasicHttpsBinding.cs
|
||||
System.ServiceModel/BasicHttpsSecurity.cs
|
||||
System.ServiceModel/NetHttpBinding.cs
|
||||
System.ServiceModel/NetHttpMessageEncoding.cs
|
||||
System.ServiceModel.Channels/CompressionFormat.cs
|
||||
System.ServiceModel.Channels/WebSocketTransportSettings.cs
|
||||
System.ServiceModel.Channels/WebSocketTransportUsage.cs
|
||||
System.ServiceModel.Configuration/BasicHttpBindingElement_4_5.cs
|
||||
|
||||
Reference in new issue
Block a user