diff options
Diffstat (limited to 'csharp/src/Ice/AssemblyUtil.cs')
-rw-r--r-- | csharp/src/Ice/AssemblyUtil.cs | 65 |
1 files changed, 1 insertions, 64 deletions
diff --git a/csharp/src/Ice/AssemblyUtil.cs b/csharp/src/Ice/AssemblyUtil.cs index 454fde42b1b..9eb8805235a 100644 --- a/csharp/src/Ice/AssemblyUtil.cs +++ b/csharp/src/Ice/AssemblyUtil.cs @@ -13,9 +13,7 @@ namespace IceInternal using System; using System.Collections; using System.Collections.Generic; - using System.Diagnostics; using System.Reflection; - using System.Threading; public sealed class AssemblyUtil { @@ -53,34 +51,8 @@ namespace IceInternal runtimeRevision_ = v.Revision; v = System.Environment.OSVersion.Version; - xp_ = v.Major == 5 && v.Minor == 1; // Are we running on XP? osx_ = false; -#if COMPACT || SILVERLIGHT - // - // Populate the _iceAssemblies list with the fully-qualified names - // of the standard Ice assemblies. The fully-qualified name looks - // like this: - // - // Ice, Version=X.Y.Z.0, Culture=neutral, PublicKeyToken=... - // - string name = Assembly.GetExecutingAssembly().FullName; - _iceAssemblies.Add(name); - int pos = name.IndexOf(','); - if(pos >= 0 && pos < name.Length - 1) - { - // - // Strip off the leading assembly name and use the remainder of the - // string to compose the names of the other standard assemblies. - // - string suffix = name.Substring(pos + 1); - _iceAssemblies.Add("Glacier2," + suffix); - _iceAssemblies.Add("IceBox," + suffix); - _iceAssemblies.Add("IceGrid," + suffix); - _iceAssemblies.Add("IcePatch2," + suffix); - _iceAssemblies.Add("IceStorm," + suffix); - } -#elif !UNITY if (platform_ == Platform.NonWindows) { try @@ -107,7 +79,6 @@ namespace IceInternal { } } -#endif } public static Type findType(Instance instance, string csharpId) @@ -119,33 +90,7 @@ namespace IceInternal { return t; } -#if COMPACT || SILVERLIGHT - string[] assemblies = instance.factoryAssemblies(); - for(int i = 0; i < assemblies.Length; ++i) - { - string s = csharpId + "," + assemblies[i]; - if((t = Type.GetType(s)) != null) - { - _typeTable[csharpId] = t; - return t; - } - } - // - // As a last resort, look for the type in the standard Ice assemblies. - // This avoids the need for a program to set a property such as: - // - // Ice.FactoryAssemblies=Ice - // - foreach(string a in _iceAssemblies) - { - string s = csharpId + "," + a; - if((t = Type.GetType(s)) != null) - { - _typeTable[csharpId] = t; - return t; - } - } -#else + loadAssemblies(); // Lazy initialization foreach (Assembly a in _loadedAssemblies.Values) { @@ -155,12 +100,10 @@ namespace IceInternal return t; } } -#endif } return null; } -#if !COMPACT && !SILVERLIGHT public static Type[] findTypesWithPrefix(string prefix) { LinkedList<Type> l = new LinkedList<Type>(); @@ -188,7 +131,6 @@ namespace IceInternal } return result; } -#endif public static object createInstance(Type t) { @@ -202,7 +144,6 @@ namespace IceInternal } } -#if !COMPACT && !SILVERLIGHT // // Make sure that all assemblies that are referenced by this process // are actually loaded. This is necessary so we can use reflection @@ -264,9 +205,6 @@ namespace IceInternal } private static Hashtable _loadedAssemblies = new Hashtable(); // <string, Assembly> pairs. -#else - private static List<string> _iceAssemblies = new List<string>(); -#endif private static Dictionary<string, Type> _typeTable = new Dictionary<string, Type>(); // <type name, Type> pairs. private static object _mutex = new object(); @@ -281,7 +219,6 @@ namespace IceInternal public readonly static int runtimeRevision_; public readonly static Platform platform_; - public readonly static bool xp_; public readonly static bool osx_; } |