private void FindPluginClassesInAssembly(Assembly assembly) { try { if (FiddlerApplication.Prefs.GetBoolPref("fiddler.debug.extensions.verbose", false)) { FiddlerApplication.Log.LogFormat("Scanning for WebTestPlugins in {0}.", new object[] { assembly.FullName }); } Type[] exportedTypes = assembly.GetExportedTypes(); for (int i = 0; i < (int)exportedTypes.Length; i++) { Type oType = exportedTypes[i]; if (!oType.IsAbstract && oType.IsPublic && oType.IsClass && typeof(IFiddlerWebTestPlugin).IsAssignableFrom(oType)) { if (FiddlerApplication.Prefs.GetBoolPref("fiddler.debug.extensions.verbose", false)) { FiddlerApplication.Log.LogFormat("WebTestPlugin found: {0}.", new object[] { oType.FullName }); } PluginClassInfo pluginInfo = new PluginClassInfo() { Assembly = assembly.FullName, Classname = oType.Name, Namespace = oType.Namespace, AssemblyLocation = assembly.Location }; this.m_plugins.Add(new PluginClassReference(pluginInfo)); } } } catch (Exception exception) { Exception eX = exception; if (FiddlerApplication.Prefs.GetBoolPref("fiddler.debug.extensions.verbose", false)) { FiddlerApplication.Log.LogFormat("Failed to load {0} to find plugin classes; exception was {1}", new object[] { assembly.FullName, eX }); } } }
public PluginClassReference(PluginClassInfo PluginInfo) { this.m_PluginInfo = PluginInfo; }