Example #1
0
        private void Register(CrossDomainTraceHelper parentDomain, TextWriter parentConsoleWriter)
        {
            // Store the parent domain to pass messages to later
            this.parentDomain = parentDomain;

            // Create and register the delegate trace listener
            var traceListener = new DelegateTraceListener(this.TraceWrite, this.TraceWriteLine);

            Trace.Listeners.Add(traceListener);
            Console.SetOut(parentConsoleWriter);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="AssemblyLoader" /> class.
        /// </summary>
        /// <param name="logger">The logger.</param>
        public AssemblyLoader(IMessageLogger logger)
        {
            this.textWriter = new TextWriterLogger(logger);

            this.appDomainHelper = new AppDomainHelper();

            this.delegateTraceListener = new DelegateTraceListener(
                message => logger.SendMessage(TestMessageLevel.Informational, message));

            this.proxyDomain = this.appDomainHelper.CreateInstance <ProxyLoader>();
        }