Merge pull request #439 from mono-soc-2012/garyb/iconfix
[mono.git] / mcs / class / corlib / System.Runtime.Remoting / RemotingConfiguration.cs
index 8236e22605b4ab62cbcae0be109d14449f6a575d..33fef7a0a8d2c26525bdb5146ef1093305ae47d7 100644 (file)
@@ -31,6 +31,7 @@
 //
 
 using System;
+using System.Globalization;
 using System.IO;
 using System.Reflection;
 using System.Collections;
@@ -41,26 +42,14 @@ using Mono.Xml;
 
 namespace System.Runtime.Remoting
 {      
-#if NET_2_0
        [System.Runtime.InteropServices.ComVisible (true)]
        public static class RemotingConfiguration
-#else
-       public class RemotingConfiguration
-#endif
        {
-#if !NET_2_0
-               //
-               // Private constructor: nobody instantiates this.
-               //
-               private RemotingConfiguration ()
-               {
-               }
-#endif
                
                static string applicationID = null;
                static string applicationName = null;
-               static string configFile = "";
-               static SmallXmlParser parser = null; 
+//             static string configFile = "";
+//             static SmallXmlParser parser = null; 
                static string processGuid = null;
                static bool defaultConfigRead = false;
                static bool defaultDelayedConfigRead = false;
@@ -92,14 +81,12 @@ namespace System.Runtime.Remoting
                        set { applicationName = value; }
                }
 
-#if NET_2_0
                [MonoTODO]
                public static CustomErrorsModes CustomErrorsMode
                {
                        get { throw new NotImplementedException (); }
                        set { throw new NotImplementedException (); }
                }
-#endif
 
                public static string ProcessId 
                {
@@ -114,13 +101,8 @@ namespace System.Runtime.Remoting
 
                // public methods
                
-#if NET_2_0
-               [MonoTODO ("Implement ensureSecurity")]
-               public
-#else
-               internal
-#endif
-               static void Configure (string filename, bool ensureSecurity) 
+               [MonoTODO ("ensureSecurity support has not been implemented")]
+               public static void Configure (string filename, bool ensureSecurity) 
                {
                        lock (channelTemplates) {
                                if (!defaultConfigRead) {
@@ -132,9 +114,8 @@ namespace System.Runtime.Remoting
                                        ReadConfigFile (filename);
                        }
                }
-#if NET_2_0
+
                [Obsolete ("Use Configure(String,Boolean)")]
-#endif
                public static void Configure (string filename) 
                {
                        Configure (filename, false);
@@ -211,19 +192,19 @@ namespace System.Runtime.Remoting
                        }
                }
 
-               public static bool IsActivationAllowed (Type serverType) 
+               public static bool IsActivationAllowed (Type svrType) 
                {
                        lock (channelTemplates)
                        {
-                               return activatedServiceEntries.ContainsKey (serverType);
+                               return activatedServiceEntries.ContainsKey (svrType);
                        }
                }
 
-               public static ActivatedClientTypeEntry IsRemotelyActivatedClientType (Type serviceType) 
+               public static ActivatedClientTypeEntry IsRemotelyActivatedClientType (Type svrType) 
                {
                        lock (channelTemplates)
                        {
-                               return activatedClientEntries [serviceType] as ActivatedClientTypeEntry;
+                               return activatedClientEntries [svrType] as ActivatedClientTypeEntry;
                        }
                }
 
@@ -232,11 +213,11 @@ namespace System.Runtime.Remoting
                        return IsRemotelyActivatedClientType (Assembly.Load(assemblyName).GetType (typeName));
                }
 
-               public static WellKnownClientTypeEntry IsWellKnownClientType (Type serviceType) 
+               public static WellKnownClientTypeEntry IsWellKnownClientType (Type svrType) 
                {
                        lock (channelTemplates)
                        {
-                               return wellKnownClientEntries [serviceType] as WellKnownClientTypeEntry;
+                               return wellKnownClientEntries [svrType] as WellKnownClientTypeEntry;
                        }
                }
 
@@ -298,9 +279,9 @@ namespace System.Runtime.Remoting
                        }
                }
 
-               public static void RegisterWellKnownServiceType (Type type, string objectUrl, WellKnownObjectMode mode) 
+               public static void RegisterWellKnownServiceType (Type type, string objectUri, WellKnownObjectMode mode) 
                {
-                       RegisterWellKnownServiceType (new WellKnownServiceTypeEntry (type, objectUrl, mode));
+                       RegisterWellKnownServiceType (new WellKnownServiceTypeEntry (type, objectUri, mode));
                }
 
                public static void RegisterWellKnownServiceType (WellKnownServiceTypeEntry entry) 
@@ -383,14 +364,12 @@ namespace System.Runtime.Remoting
                        }
                }
                
-#if NET_1_1
                public static bool CustomErrorsEnabled (bool isLocalRequest)
                {
                        if (_errorMode == "off") return false;
                        if (_errorMode == "on") return true;
                        return !isLocalRequest;
                }
-#endif
 
                internal static void SetCustomErrorsMode (string mode)
                {
@@ -440,10 +419,11 @@ namespace System.Runtime.Remoting
                
                bool CheckPath (string path)
                {
-                       if (path.StartsWith ("/"))
+                       CompareInfo ci = CultureInfo.InvariantCulture.CompareInfo;
+                       if (ci.IsPrefix (path, "/", CompareOptions.Ordinal))
                                return path == currentXmlPath;
                        else
-                               return currentXmlPath.EndsWith (path);
+                               return ci.IsSuffix (currentXmlPath, path, CompareOptions.Ordinal);
                }
                
                public void OnStartParsing (SmallXmlParser parser) {}