From 879250e50583d8fb2898110f806ee90aa15a4c4b Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Mon, 4 Mar 2013 12:40:21 -0500 Subject: [PATCH] Misc PCL-related API fixes. --- .../ValidationContext.cs | 21 +++++++++++++++++++ mcs/class/System/System.Net/HttpWebRequest.cs | 4 ++-- mcs/class/System/System.Net/WebRequest.cs | 2 +- mcs/class/System/System.Net/WebResponse.cs | 2 +- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationContext.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationContext.cs index e99efe58d4017..f39c4a4232428 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationContext.cs +++ b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationContext.cs @@ -65,7 +65,28 @@ public ValidationContext (object instance, IServiceProvider serviceProvider, IDi // else ServiceContainer = new ValidationContextServiceContainer (); } + +#if NET_4_5 + public ValidationContext (object instance) + : this (instance, null, null) + { + } + + public ValidationContext (object instance, IDictionary items) + : this (instance, null, items) + { + } + // FIXME: According to MSDN, this should be defined in + // 4.5, Silverlight and PCL + [MonoTODO] + public void InitializeServiceProvider ( + Func serviceProvider) + { + throw new NotImplementedException (); + } +#endif + public object GetService (Type serviceType) { return ServiceContainer.GetService (serviceType); diff --git a/mcs/class/System/System.Net/HttpWebRequest.cs b/mcs/class/System/System.Net/HttpWebRequest.cs index 26cff2d070f40..60ec0e626926b 100644 --- a/mcs/class/System/System.Net/HttpWebRequest.cs +++ b/mcs/class/System/System.Net/HttpWebRequest.cs @@ -559,9 +559,9 @@ static bool CheckValidHost (string scheme, string val) internal ServicePoint ServicePointNoLock { get { return servicePoint; } } -#if NET_4_5 +#if NET_4_0 [MonoTODO ("for portable library support")] - public bool SupportsCookieContainer { + public virtual bool SupportsCookieContainer { get { throw new NotImplementedException (); } diff --git a/mcs/class/System/System.Net/WebRequest.cs b/mcs/class/System/System.Net/WebRequest.cs index fcdaeccfea007..d096af72eac55 100644 --- a/mcs/class/System/System.Net/WebRequest.cs +++ b/mcs/class/System/System.Net/WebRequest.cs @@ -296,7 +296,7 @@ public static WebRequest CreateDefault (Uri requestUri) throw new ArgumentNullException ("requestUri"); return GetCreator (requestUri.Scheme).Create (requestUri); } -#if NET_4_5 +#if NET_4_0 [MonoTODO ("for portable library support")] public static HttpWebRequest CreateHttp (string requestUriString) { diff --git a/mcs/class/System/System.Net/WebResponse.cs b/mcs/class/System/System.Net/WebResponse.cs index a6582ab960bd2..7e544a560d33b 100644 --- a/mcs/class/System/System.Net/WebResponse.cs +++ b/mcs/class/System/System.Net/WebResponse.cs @@ -85,7 +85,7 @@ public virtual bool IsMutuallyAuthenticated public virtual Uri ResponseUri { get { throw new NotSupportedException (); } } -#if NET_4_5 +#if NET_4_0 [MonoTODO ("for portable library support")] public virtual bool SupportsHeaders { get { throw new NotImplementedException (); }