diff options
author | Jose <jose@zeroc.com> | 2018-06-28 15:46:50 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2018-06-28 15:46:50 +0200 |
commit | b3763409f91afc54bf8f014d6e92772d6fc34dcb (patch) | |
tree | cdefc610ff161953073337ce0503e505078b4f9a /csharp/src/Ice/Instance.cs | |
parent | Fixed dispatcher test hang (fixes #123) (diff) | |
download | ice-b3763409f91afc54bf8f014d6e92772d6fc34dcb.tar.bz2 ice-b3763409f91afc54bf8f014d6e92772d6fc34dcb.tar.xz ice-b3763409f91afc54bf8f014d6e92772d6fc34dcb.zip |
Add support cs:namespace metadata
Add support to map Slice modules to different namespaces
using cs:namespace metadata
Fixes #122 slice2cs generates invalid namespace qualification
Diffstat (limited to 'csharp/src/Ice/Instance.cs')
-rw-r--r-- | csharp/src/Ice/Instance.cs | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/csharp/src/Ice/Instance.cs b/csharp/src/Ice/Instance.cs index 6936f13ef71..136d5208889 100644 --- a/csharp/src/Ice/Instance.cs +++ b/csharp/src/Ice/Instance.cs @@ -672,7 +672,38 @@ namespace IceInternal public Type resolveClass(string id) { - Type c = AssemblyUtil.findType(this, typeToClass(id)); + string className = typeToClass(id); + + Type c = AssemblyUtil.findType(this, className); + + // + // See if the application defined an Ice.Package.MODULE property. + // + if(c == null) + { + int pos = id.IndexOf(':', 2); + if(pos != -1) + { + String topLevelModule = id.Substring(2, pos - 2); + String pkg = _initData.properties.getProperty("Ice.Package." + topLevelModule); + if(pkg.Length > 0) + { + c = AssemblyUtil.findType(this, pkg + "." + className); + } + } + } + + // + // See if the application defined a default package. + // + if(c == null) + { + String pkg = _initData.properties.getProperty("Ice.Default.Package"); + if(pkg.Length > 0) + { + c = AssemblyUtil.findType(this, pkg + "." + className); + } + } // // Ensure the class is instantiable. |