Browse Source

Add MOBILE defines to 4.0 code

Marek Safar 13 years ago
parent
commit
e3484720bb

+ 1 - 1
mcs/class/System.ServiceModel.Web/System.ServiceModel.Web/WebOperationContext.cs

@@ -111,7 +111,7 @@ namespace System.ServiceModel.Web
 			// 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;
 

+ 1 - 1
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;

+ 5 - 1
mcs/class/System.Web/System.Web.Util/HttpEncoder.cs

@@ -35,7 +35,7 @@ using System.Collections.Generic;
 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 @@ namespace System.Web.Util
 
 		static HttpEncoder GetCustomEncoderFromConfig ()
 		{
+#if MOBILE
+			return defaultEncoder.Value;
+#else
 			var cfg = HttpRuntime.Section;
 			string typeName = cfg.EncoderType;
 
@@ -204,6 +207,7 @@ namespace System.Web.Util
 				);
 
 			return Activator.CreateInstance (t, false) as HttpEncoder;
+#endif
 		}
 #endif
 #if NET_4_0

+ 3 - 1
mcs/class/System.Web/System.Web/HttpUtility.cs

@@ -552,10 +552,12 @@ namespace System.Web {
 			if (value == null)
 				return null;
 
+#if !MOBILE
 			IHtmlString htmlString = value as IHtmlString;
 			if (htmlString != null)
 				return htmlString.ToHtmlString ();
-			
+#endif
+
 			return HtmlEncode (value.ToString ());
 		}
 

+ 2 - 1
mcs/class/corlib/System.Reflection/Assembly.cs

@@ -889,7 +889,6 @@ namespace System.Reflection {
 				}
 			}
 		}
-#endif
 		
 #if NET_4_0
 		public virtual PermissionSet PermissionSet {
@@ -901,6 +900,8 @@ namespace System.Reflection {
 		}
 #endif
 
+#endif
+
 #if NET_4_0 || MOONLIGHT || MOBILE
 		static Exception CreateNIE ()
 		{

+ 20 - 20
mcs/class/corlib/System/Console.cs

@@ -217,26 +217,6 @@ namespace System
 			}
 		}
 
-#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 @@ namespace System
 			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);