public void LoadAssembly(string assemblyFile) { try { this.name = Path.GetFileName(assemblyFile); this.domain = AppDomain.CreateDomain(this.name); Type typeFromHandle = typeof(PluginInstanceFactory); this.factory = (PluginInstanceFactory)this.domain.CreateInstance(typeFromHandle.Assembly.FullName, typeFromHandle.FullName).Unwrap(); IDictionary <string, string> dictionary = this.factory.LoadTypeForAll(assemblyFile); foreach (KeyValuePair <string, string> current in dictionary) { PluginConnector value = new PluginConnector(assemblyFile, this.factory, current.Value); this.plugins.Add(current.Key, value); } } catch (Exception) { } }
public PluginConnector(string assemblyFile, PluginInstanceFactory factory, string plugName) { this.name = plugName; this.assemblyFile = assemblyFile; this.factory = factory; }