/// <summary> /// Processes resolution of an assembly by raising an event. /// </summary> /// <param name="a">The assembly that has been resolved.</param> private void OnTypeResolved(Assembly a) { if (this.TypeResolved != null) { ProxyAssemblyEventArgs args = new ProxyAssemblyEventArgs(); args.Assembly = a; this.TypeResolved(this, args); } }
/// <summary> /// Handles the event when a type is resolved. Used to add the the assembly to the list of assemblies needed for the proxies. /// </summary> /// <param name="sender">The sender of the event.</param> /// <param name="e">The event arguments.</param> private void TypeResolvedHandler(object sender, ProxyAssemblyEventArgs e) { Trace.WriteLine(string.Format(CultureInfo.InvariantCulture, "Resolved a proxy type from the assembly {0}", e.Assembly.FullName)); bool found = false; foreach (Assembly a in this.proxyAssemblies) { if (a.FullName == e.Assembly.FullName) { found = true; break; } } if (!found) { this.proxyAssemblies.Add(e.Assembly); } }