Merge pull request #439 from mono-soc-2012/garyb/iconfix
[mono.git] / mcs / class / corlib / System.Runtime.Remoting / RemotingConfiguration.cs
index 802ba8b3eaf6c3bb0031ae979bddf3c3187cfde3..33fef7a0a8d2c26525bdb5146ef1093305ae47d7 100644 (file)
@@ -31,6 +31,7 @@
 //
 
 using System;
+using System.Globalization;
 using System.IO;
 using System.Reflection;
 using System.Collections;
@@ -41,19 +42,14 @@ using Mono.Xml;
 
 namespace System.Runtime.Remoting
 {      
-       public class RemotingConfiguration
+       [System.Runtime.InteropServices.ComVisible (true)]
+       public static class RemotingConfiguration
        {
-               //
-               // Private constructor: nobody instantiates this.
-               //
-               private RemotingConfiguration ()
-               {
-               }
                
                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;
@@ -84,7 +80,14 @@ namespace System.Runtime.Remoting
                        get { return applicationName; }
                        set { applicationName = value; }
                }
-               
+
+               [MonoTODO]
+               public static CustomErrorsModes CustomErrorsMode
+               {
+                       get { throw new NotImplementedException (); }
+                       set { throw new NotImplementedException (); }
+               }
+
                public static string ProcessId 
                {
                        get {
@@ -98,21 +101,26 @@ namespace System.Runtime.Remoting
 
                // public methods
                
-               public static void Configure (string filename) 
+               [MonoTODO ("ensureSecurity support has not been implemented")]
+               public static void Configure (string filename, bool ensureSecurity) 
                {
-                       lock (channelTemplates)
-                       {
-                               if (!defaultConfigRead)
-                               {
+                       lock (channelTemplates) {
+                               if (!defaultConfigRead) {
                                        ReadConfigFile (Environment.GetMachineConfigPath ());
                                        defaultConfigRead = true;
                                }
-                               
+
                                if (filename != null)
                                        ReadConfigFile (filename);
                        }
                }
 
+               [Obsolete ("Use Configure(String,Boolean)")]
+               public static void Configure (string filename) 
+               {
+                       Configure (filename, false);
+               }
+
                private static void ReadConfigFile (string filename)
                {
                        try
@@ -184,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;
                        }
                }
 
@@ -205,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;
                        }
                }
 
@@ -271,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) 
@@ -356,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)
                {
@@ -413,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) {}