Imported Upstream version 4.8.0.309

Former-commit-id: 5f9c6ae75f295e057a7d2971f3a6df4656fa8850
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-11-10 13:04:39 +00:00
parent ee1447783b
commit 94b2861243
4912 changed files with 390737 additions and 49310 deletions

View File

@@ -53,7 +53,7 @@ using System.Runtime.InteropServices;
[assembly: ComVisible (false)]
[assembly: AssemblyDelaySign (true)]
#if NET_2_1
#if MOBILE
[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
[assembly: AssemblyKeyFile ("../silverlight.pub")]
#else
@@ -61,7 +61,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyKeyFile("../winfx.pub")]
#endif
#if NET_2_1
#if MOBILE
[assembly: InternalsVisibleTo ("System.Json, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
[assembly: InternalsVisibleTo ("System.ServiceModel.Web.Extensions, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
[assembly: InternalsVisibleTo ("System.Windows.Browser, PublicKey=00240000048000009400000006020000002400005253413100040000010001008D56C76F9E8649383049F383C44BE0EC204181822A6C31CF5EB7EF486944D032188EA1D3920763712CCB12D75FB77E9811149E6148E5D32FBAAB37611C1878DDC19E20EF135D0CB2CFF2BFEC3D115810C3D9069638FE4BE215DBF795861920E5AB6F7DB2E2CEEF136AC23D5DD2BF031700AEC232F6C6B1C785B4305C123B37AB")]

View File

@@ -47,7 +47,7 @@ namespace System.ServiceModel.Channels
}
public override string ContentType {
#if NET_2_1
#if MOBILE
get { return MediaType; }
#else
get { return MediaType + "; charset=" + source.WriteEncoding.HeaderName; }
@@ -114,7 +114,7 @@ namespace System.ServiceModel.Channels
break;
case WebContentFormat.Json:
// FIXME: is it safe/unsafe/required to keep XmlReader open?
#if NET_2_1
#if MOBILE
msg = Message.CreateMessage (MessageVersion.None, null, JsonReaderWriterFactory.CreateJsonReader (stream, source.ReaderQuotas));
#else
msg = Message.CreateMessage (MessageVersion.None, null, JsonReaderWriterFactory.CreateJsonReader (stream, enc, source.ReaderQuotas, null));
@@ -174,7 +174,7 @@ namespace System.ServiceModel.Channels
switch (GetContentFormat (message)) {
case WebContentFormat.Xml:
#if NET_2_1
#if MOBILE
using (XmlWriter w = XmlDictionaryWriter.CreateDictionaryWriter (XmlWriter.Create (new StreamWriter (stream, source.WriteEncoding))))
message.WriteMessage (w);
#else

View File

@@ -34,7 +34,7 @@ using System.Xml;
namespace System.ServiceModel.Channels
{
public sealed class WebMessageEncodingBindingElement
#if NET_2_1
#if MOBILE
: MessageEncodingBindingElement
#else
: MessageEncodingBindingElement, IWsdlExportExtension
@@ -109,7 +109,7 @@ namespace System.ServiceModel.Channels
return base.BuildChannelFactory<TChannel> (context);
}
#if !NET_2_1
#if !MOBILE
[MonoTODO ("Why is it overriden?")]
public override bool CanBuildChannelListener<TChannel> (BindingContext context)
{
@@ -146,7 +146,7 @@ namespace System.ServiceModel.Channels
return context.GetInnerProperty<T> ();
}
#if !NET_2_1 && !XAMMAC_4_5
#if !MOBILE && !XAMMAC_4_5
[MonoTODO]
void IWsdlExportExtension.ExportContract (WsdlExporter exporter, WsdlContractConversionContext context)
{

View File

@@ -84,7 +84,7 @@ namespace System.ServiceModel.Description
// clientRuntime.MessageInspectors.Add (something);
}
#if !NET_2_1 && !XAMMAC_4_5
#if !MOBILE && !XAMMAC_4_5
protected virtual void AddServerErrorHandlers (ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
{
endpointDispatcher.ChannelDispatcher.ErrorHandlers.Add (new WebHttpErrorHandler ());
@@ -103,7 +103,7 @@ namespace System.ServiceModel.Description
public virtual void ApplyDispatchBehavior (ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
{
#if NET_2_1 || XAMMAC_4_5
#if MOBILE || XAMMAC_4_5
throw new NotImplementedException ();
#else
endpointDispatcher.DispatchRuntime.OperationSelector = GetOperationSelector (endpoint);
@@ -146,7 +146,7 @@ namespace System.ServiceModel.Description
}
}
#if !NET_2_1 && !XAMMAC_4_5
#if !MOBILE && !XAMMAC_4_5
internal class DispatchPairFormatter : IDispatchMessageFormatter
{
public DispatchPairFormatter (IDispatchMessageFormatter request, IDispatchMessageFormatter reply)
@@ -185,7 +185,7 @@ namespace System.ServiceModel.Description
return new WebMessageFormatter.ReplyClientFormatter (operationDescription, endpoint, GetQueryStringConverter (operationDescription), this);
}
#if !NET_2_1
#if !MOBILE
protected virtual IDispatchMessageFormatter GetReplyDispatchFormatter (OperationDescription operationDescription, ServiceEndpoint endpoint)
{
return new WebMessageFormatter.ReplyDispatchFormatter (operationDescription, endpoint, GetQueryStringConverter (operationDescription), this);
@@ -197,7 +197,7 @@ namespace System.ServiceModel.Description
return new WebMessageFormatter.RequestClientFormatter (operationDescription, endpoint, GetQueryStringConverter (operationDescription), this);
}
#if !NET_2_1
#if !MOBILE
protected virtual IDispatchMessageFormatter GetRequestDispatchFormatter (OperationDescription operationDescription, ServiceEndpoint endpoint)
{
return new WebMessageFormatter.RequestDispatchFormatter (operationDescription, endpoint, GetQueryStringConverter (operationDescription), this);
@@ -287,7 +287,7 @@ namespace System.ServiceModel.Description
throw new InvalidOperationException ("ManualAddressing in the transport binding element in the binding must be true for WebHttpBehavior");
}
#if !NET_2_1
#if !MOBILE
internal class WebHttpErrorHandler : IErrorHandler
{
public void ProvideFault (Exception error, MessageVersion version, ref Message fault)

View File

@@ -41,7 +41,7 @@ using System.ServiceModel.Web;
using System.Text;
using System.Xml;
#if NET_2_1
#if MOBILE
using XmlObjectSerializer = System.Object;
#endif
@@ -81,7 +81,7 @@ namespace System.ServiceModel.Dispatcher
this.converter = converter;
this.behavior = behavior;
ApplyWebAttribute ();
#if !NET_2_1
#if !MOBILE
// This is a hack for WebScriptEnablingBehavior
var jqc = converter as JsonQueryStringConverter;
if (jqc != null)
@@ -248,7 +248,7 @@ namespace System.ServiceModel.Dispatcher
protected object ReadObjectBody (XmlObjectSerializer serializer, XmlReader reader)
{
#if NET_2_1
#if MOBILE
return (serializer is DataContractJsonSerializer) ?
((DataContractJsonSerializer) serializer).ReadObject (reader) :
((DataContractSerializer) serializer).ReadObject (reader, true);
@@ -283,7 +283,7 @@ namespace System.ServiceModel.Dispatcher
}
}
#if !NET_2_1
#if !MOBILE
internal class RequestDispatchFormatter : WebDispatchMessageFormatter
{
public RequestDispatchFormatter (OperationDescription operation, ServiceEndpoint endpoint, QueryStringConverter converter, WebHttpBehavior behavior)
@@ -363,7 +363,7 @@ namespace System.ServiceModel.Dispatcher
// FIXME: get encoding from somewhere
hp.Headers ["Content-Type"] = mediaType + "; charset=utf-8";
#if !NET_2_1
#if !MOBILE
if (WebOperationContext.Current != null)
WebOperationContext.Current.OutgoingRequest.Apply (hp);
#endif
@@ -382,7 +382,7 @@ namespace System.ServiceModel.Dispatcher
throw new ArgumentNullException ("parameters");
CheckMessageVersion (message.Version);
#if !NET_2_1
#if !MOBILE
if (OperationContext.Current != null) {
// Set response in the context
OperationContext.Current.IncomingMessage = message;
@@ -423,7 +423,7 @@ namespace System.ServiceModel.Dispatcher
object value;
XmlObjectSerializer serializer;
#if !NET_2_1
#if !MOBILE
protected override BodyWriter OnCreateBufferedCopy (int maxBufferSize)
{
return new WrappedBodyWriter (value, serializer, name, ns, fmt);
@@ -473,7 +473,7 @@ namespace System.ServiceModel.Dispatcher
void WriteObject (XmlObjectSerializer serializer, XmlDictionaryWriter writer, object value)
{
if (serializer != null){
#if NET_2_1
#if MOBILE
if (serializer is DataContractJsonSerializer)
((DataContractJsonSerializer) serializer).WriteObject (writer, value);
else
@@ -485,7 +485,7 @@ namespace System.ServiceModel.Dispatcher
}
}
#if !NET_2_1
#if !MOBILE
internal abstract class WebDispatchMessageFormatter : WebMessageFormatter, IDispatchMessageFormatter
{
protected WebDispatchMessageFormatter (OperationDescription operation, ServiceEndpoint endpoint, QueryStringConverter converter, WebHttpBehavior behavior)

View File

@@ -39,7 +39,7 @@ namespace System.ServiceModel.Web
{
public class WebChannelFactory<TChannel> : ChannelFactory<TChannel>
{
#if !NET_2_1
#if !MOBILE
public WebChannelFactory ()
: base ()
{
@@ -84,7 +84,7 @@ namespace System.ServiceModel.Web
protected override void OnOpening ()
{
#if !NET_2_1
#if !MOBILE
if (Endpoint.Behaviors.Find<WebHttpBehavior> () == null)
Endpoint.Behaviors.Add (new WebHttpBehavior ());
#endif

View File

@@ -31,7 +31,7 @@ using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
#if NET_2_1 // Note that moonlight System.ServiceModel.Web.dll does not contain this class.
#if MOBILE // Note that moonlight System.ServiceModel.Web.dll does not contain this class.
using IncomingWebRequestContext = System.Object;
using OutgoingWebResponseContext = System.Object;
#else
@@ -44,11 +44,11 @@ using System.Xml.Serialization;
namespace System.ServiceModel.Web
{
public class WebOperationContext
#if !NET_2_1
#if !MOBILE
: IExtension<OperationContext>
#endif
{
#if !NET_2_1
#if !MOBILE
public static WebOperationContext Current {
get {
if (OperationContext.Current == null)
@@ -75,13 +75,13 @@ namespace System.ServiceModel.Web
outgoing_request = new OutgoingWebRequestContext ();
incoming_response = new IncomingWebResponseContext (operation);
#if !NET_2_1
#if !MOBILE
incoming_request = new IncomingWebRequestContext (operation);
outgoing_response = new OutgoingWebResponseContext ();
#endif
}
#if !NET_2_1
#if !MOBILE
public IncomingWebRequestContext IncomingRequest {
get { return incoming_request; }
}
@@ -95,7 +95,7 @@ namespace System.ServiceModel.Web
get { return outgoing_request; }
}
#if !NET_2_1
#if !MOBILE
public OutgoingWebResponseContext OutgoingResponse {
get { return outgoing_response; }
}

View File

@@ -31,7 +31,7 @@ using System.Linq;
using System.ServiceModel.Channels;
using System.Text;
using System.Xml;
#if !NET_2_1
#if !MOBILE
using System.Configuration;
using System.ServiceModel.Configuration;
#endif
@@ -52,7 +52,7 @@ namespace System.ServiceModel
public WebHttpBinding (string configurationName)
{
#if !NET_2_1 && !XAMMAC_4_5
#if !MOBILE && !XAMMAC_4_5
BindingsSection bindingsSection = ConfigUtil.BindingsSection;
WebHttpBindingElement el = (WebHttpBindingElement) bindingsSection ["webHttpBinding"].ConfiguredBindings.FirstOrDefault (c => c.Name == configurationName);
if (el != null) {
@@ -88,7 +88,7 @@ namespace System.ServiceModel
get { return EnvelopeVersion.None; }
}
#if !NET_2_1 && !XAMMAC_4_5
#if !MOBILE && !XAMMAC_4_5
[DefaultValue (false)]
public bool AllowCookies {
get { return t.AllowCookies; }

View File

@@ -34,7 +34,7 @@ namespace System.ServiceModel
public WebHttpSecurity ()
{
// there is no public constructor for transport ...
#if !NET_2_1
#if !MOBILE
Transport = new BasicHttpBinding ().Security.Transport;
#endif
}