private void Init(string dllName) { try { provider = Assembly.LoadFrom(dllName); Type[] types = provider.GetTypes(); for(int i = 0; i < types.Length; i++) { Type[] interfaces = types[i].GetInterfaces(); for(int j = 0; j < interfaces.Length; j++) { if(interfaces[j].FullName.Equals("netz.compress.ICompress")) { ConstructorInfo ci = types[i].GetConstructor(Type.EmptyTypes); icompress = (netz.compress.ICompress)ci.Invoke(null); break; } } if(icompress != null) break; } } catch(Exception ex) { throw new Exception("E1001 Cannot initialize compression provider " + ex.Message); } }
private void Init(string dllName) { try { provider = Assembly.LoadFrom(dllName); Type[] types = provider.GetTypes(); for (int i = 0; i < types.Length; i++) { Type[] interfaces = types[i].GetInterfaces(); for (int j = 0; j < interfaces.Length; j++) { if (interfaces[j].FullName.Equals("netz.compress.ICompress")) { ConstructorInfo ci = types[i].GetConstructor(Type.EmptyTypes); icompress = (netz.compress.ICompress)ci.Invoke(null); break; } } if (icompress != null) { break; } } } catch (Exception ex) { throw new Exception("E1001 Cannot initialize compression provider " + ex.Message); } }