//アセンブリから宣言のあるTypeを取り出す public void TryToBind(ITracer tracer) { List <Type> types = new List <Type>(); IList entries = _manifest.FindMultipleEntries("plugin"); if (entries.Count == 0) //アセンブリに埋め込まれたAttributeからロード { PluginDeclarationAttribute[] decls = (PluginDeclarationAttribute[])_assembly.GetCustomAttributes(typeof(PluginDeclarationAttribute), false); foreach (PluginDeclarationAttribute decl in decls) { types.Add(decl.Target); } } else { foreach (string name in entries) { try { Type t = _assembly.GetType(name); if (t == null) { tracer.Trace("PluginManager.Messages.TypeLoadError", _assembly.CodeBase, name); } else { types.Add(t); } } catch (Exception) { tracer.Trace("PluginManager.Messages.TypeLoadError", _assembly.CodeBase, name); } } } _pluginTypes = types.ToArray(); }