diff --git a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/WebOperationContext.cs b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/WebOperationContext.cs index 587880e9c6c98..9857450eded08 100644 --- a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/WebOperationContext.cs +++ b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/WebOperationContext.cs @@ -111,7 +111,7 @@ public void Detach (OperationContext context) // do nothing } -#if NET_4_0 +#if NET_4_0 && !MOBILE static readonly XmlWriterSettings settings = new XmlWriterSettings () { OmitXmlDeclaration = true, Indent = false }; XmlSerializer document_serializer, feed_serializer, item_serializer; diff --git a/mcs/class/System.ServiceModel/System.ServiceModel/BasicHttpBinding.cs b/mcs/class/System.ServiceModel/System.ServiceModel/BasicHttpBinding.cs index b3607f3d55a8a..a52e1612627b3 100644 --- a/mcs/class/System.ServiceModel/System.ServiceModel/BasicHttpBinding.cs +++ b/mcs/class/System.ServiceModel/System.ServiceModel/BasicHttpBinding.cs @@ -29,7 +29,7 @@ // 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 +#if !NET_4_5 || MOBILE using System; using System.Collections.Generic; using System.Net; diff --git a/mcs/class/System.Web/System.Web.Util/HttpEncoder.cs b/mcs/class/System.Web/System.Web.Util/HttpEncoder.cs index e2cb34bcc0e81..ddda8757888cd 100644 --- a/mcs/class/System.Web/System.Web.Util/HttpEncoder.cs +++ b/mcs/class/System.Web/System.Web.Util/HttpEncoder.cs @@ -35,7 +35,7 @@ using System.Configuration; using System.IO; using System.Text; -#if NET_4_0 +#if NET_4_0 && !MOBILE using System.Web.Configuration; #endif @@ -188,6 +188,9 @@ protected internal virtual byte[] UrlEncode (byte[] bytes, int offset, int count static HttpEncoder GetCustomEncoderFromConfig () { +#if MOBILE + return defaultEncoder.Value; +#else var cfg = HttpRuntime.Section; string typeName = cfg.EncoderType; @@ -204,6 +207,7 @@ static HttpEncoder GetCustomEncoderFromConfig () ); return Activator.CreateInstance (t, false) as HttpEncoder; +#endif } #endif #if NET_4_0 diff --git a/mcs/class/System.Web/System.Web/HttpUtility.cs b/mcs/class/System.Web/System.Web/HttpUtility.cs index e05ae9761bb67..bb821a573cfc2 100644 --- a/mcs/class/System.Web/System.Web/HttpUtility.cs +++ b/mcs/class/System.Web/System.Web/HttpUtility.cs @@ -552,10 +552,12 @@ public static string HtmlEncode (object value) if (value == null) return null; +#if !MOBILE IHtmlString htmlString = value as IHtmlString; if (htmlString != null) return htmlString.ToHtmlString (); - +#endif + return HtmlEncode (value.ToString ()); } diff --git a/mcs/class/corlib/System.Reflection/Assembly.cs b/mcs/class/corlib/System.Reflection/Assembly.cs index 6c26ab284a576..97e2bc6a984b1 100644 --- a/mcs/class/corlib/System.Reflection/Assembly.cs +++ b/mcs/class/corlib/System.Reflection/Assembly.cs @@ -889,7 +889,6 @@ private void LoadAssemblyPermissions () } } } -#endif #if NET_4_0 public virtual PermissionSet PermissionSet { @@ -901,6 +900,8 @@ private void LoadAssemblyPermissions () } #endif +#endif + #if NET_4_0 || MOONLIGHT || MOBILE static Exception CreateNIE () { diff --git a/mcs/class/corlib/System/Console.cs b/mcs/class/corlib/System/Console.cs index fe0f229e396b1..71963cdc8c3b4 100644 --- a/mcs/class/corlib/System/Console.cs +++ b/mcs/class/corlib/System/Console.cs @@ -217,26 +217,6 @@ static void SetupStreams (Encoding inputEncoding, Encoding outputEncoding) } } -#if NET_4_5 - public static bool IsErrorRedirected { - get { - return stderr != console_stderr || ConsoleDriver.IsErrorRedirected; - } - } - - public static bool IsOutputRedirected { - get { - return stdout != console_stdout || ConsoleDriver.IsOutputRedirected; - } - } - - public static bool IsInputRedirected { - get { - return stdin != console_stdin || ConsoleDriver.IsInputRedirected; - } - } -#endif - private static Stream Open (IntPtr handle, FileAccess access, int bufferSize) { #if MOONLIGHT @@ -695,6 +675,26 @@ public static string ReadLine () set { ConsoleDriver.WindowWidth = value; } } +#if NET_4_5 + public static bool IsErrorRedirected { + get { + return stderr != console_stderr || ConsoleDriver.IsErrorRedirected; + } + } + + public static bool IsOutputRedirected { + get { + return stdout != console_stdout || ConsoleDriver.IsOutputRedirected; + } + } + + public static bool IsInputRedirected { + get { + return stdin != console_stdin || ConsoleDriver.IsInputRedirected; + } + } +#endif + public static void Beep () { Beep (1000, 500);