/// <summary>
        /// Initializes a new instance of the <see cref="LogMessageListener"/> class.
        /// </summary>
        /// <param name="captureDebugTraces">Captures debug traces if true.</param>
        public LogMessageListener(bool captureDebugTraces)
        {
            this.captureDebugTraces = captureDebugTraces;

            // Cache the original output/error streams and replace it with the own stream.
            this.redirectLoggerOut = new ThreadSafeStringWriter(CultureInfo.InvariantCulture);
            this.redirectStdErr    = new ThreadSafeStringWriter(CultureInfo.InvariantCulture);

            Logger.OnLogMessage += this.redirectLoggerOut.WriteLine;

            // Cache the previous redirector if any and replace the trace listener.
            this.previousRedirector = activeRedirector;

            if (this.captureDebugTraces)
            {
                this.traceListener        = PlatformServiceProvider.Instance.GetTraceListener(new ThreadSafeStringWriter(CultureInfo.InvariantCulture));
                this.traceListenerManager = PlatformServiceProvider.Instance.GetTraceListenerManager(this.redirectLoggerOut, this.redirectStdErr);

                // If there was a previous LogMessageListener active, remove its
                // TraceListener (it will be restored when this one is disposed).
                if (this.previousRedirector != null && this.previousRedirector.traceListener != null)
                {
                    this.traceListenerManager.Remove(this.previousRedirector.traceListener);
                }

                this.traceListenerManager.Add(this.traceListener);
            }

            activeRedirector = this;
        }
        protected override void DoExecute()
        {
            if (DebugTask)
            {
                System.Diagnostics.Debugger.Launch();
            }

            ITraceListener traceListener = VerboseOutput ? (ITraceListener) new TextWriterTraceListener(GetMessageWriter(MessageImportance.High), "SpecFlow: ") : new NullListener();

            SpecFlowProject specFlowProject = MsBuildProjectReader.LoadSpecFlowProjectFromMsBuild(ProjectPath);

            BatchGenerator batchGenerator = new MsBuildBatchGenerator(traceListener, new TestGeneratorFactory(), this);

            batchGenerator.OnError +=
                delegate(FeatureFileInput featureFileInput, TestGeneratorResult result)
            {
                foreach (var testGenerationError in result.Errors)
                {
                    RecordError(testGenerationError.Message,
                                featureFileInput.GetFullPath(specFlowProject.ProjectSettings), testGenerationError.Line, testGenerationError.LinePosition);
                }
            };
            batchGenerator.OnSuccess +=
                (featureFileInput, result) => generatedFiles.Add(
                    new TaskItem(featureFileInput.GetGeneratedTestFullPath(specFlowProject.ProjectSettings)));

            batchGenerator.ProcessProject(specFlowProject, ForceGeneration);
        }
Beispiel #3
0
 public Builder(LauncherOptions options, AppLocations appLocations, IBuilderEvent builderEvent)
     : base(options, appLocations)
 {
     Counters      = new List <string>();
     traceListener = new BuilderEventListener(this);
     BuilderEvent  = builderEvent;
 }
Beispiel #4
0
 public TestTracer(ITraceListener traceListener, IStepFormatter stepFormatter, IStepDefinitionSkeletonProvider stepDefinitionSkeletonProvider, Configuration.SpecFlowConfiguration specFlowConfiguration)
 {
     this.traceListener = traceListener;
     this.stepFormatter = stepFormatter;
     this.stepDefinitionSkeletonProvider = stepDefinitionSkeletonProvider;
     this.specFlowConfiguration          = specFlowConfiguration;
 }
Beispiel #5
0
        public static ExchangeService ConnectToServiceWithImpersonation(
            IUserData userData,
            string impersonatedUserSMTPAddress,
            ITraceListener listener)
        {
            ExchangeService service = new ExchangeService(userData.Version);

            if (listener != null)
            {
                service.TraceListener = listener;
                service.TraceFlags = TraceFlags.All;
                service.TraceEnabled = true;
            }

            service.Credentials = new NetworkCredential(userData.EmailAddress, userData.Password);

            ImpersonatedUserId impersonatedUserId =
                new ImpersonatedUserId(ConnectingIdType.SmtpAddress, impersonatedUserSMTPAddress);

            service.ImpersonatedUserId = impersonatedUserId;

            if (userData.AutodiscoverUrl == null)
            {
                service.AutodiscoverUrl(userData.EmailAddress, RedirectionUrlValidationCallback);
                userData.AutodiscoverUrl = service.Url;
            }
            else
            {
                service.Url = userData.AutodiscoverUrl;
            }

            return service;
        }
Beispiel #6
0
        public static ExchangeService ConnectToService(
            IUserData userData,
            ITraceListener listener)
        {
            ExchangeService service = new ExchangeService(userData.Version);

            if (listener != null)
            {
                service.TraceListener = listener;
                service.TraceFlags = TraceFlags.All;
                service.TraceEnabled = true;
            }

            service.Credentials = new NetworkCredential(userData.EmailAddress, userData.Password);

            if (userData.AutodiscoverUrl == null)
            {
                service.AutodiscoverUrl(userData.EmailAddress, RedirectionUrlValidationCallback);
                userData.AutodiscoverUrl = service.Url;
            }
            else
            {
                service.Url = userData.AutodiscoverUrl;
            }

            return service;
        }
Beispiel #7
0
 public Builder(Options options, AppLocations appLocations, IBuilderEvent builderEvent)
     : base(options, appLocations)
 {
     Counters = new List<string>();
     traceListener = new BuilderEventListener(this);
     BuilderEvent = builderEvent;
 }
Beispiel #8
0
 public TestTracer(ITraceListener traceListener, IStepFormatter stepFormatter, IStepDefinitionSkeletonProvider stepDefinitionSkeletonProvider, RuntimeConfiguration runtimeConfiguration)
 {
     this.traceListener = traceListener;
     this.stepFormatter = stepFormatter;
     this.stepDefinitionSkeletonProvider = stepDefinitionSkeletonProvider;
     this.runtimeConfiguration           = runtimeConfiguration;
 }
        public static ExchangeService ConnectToService(IUserData userData, ITraceListener listener)
        {
            ExchangeService service = new ExchangeService(userData.Version);

            if (listener != null)
            {
                service.TraceListener = listener;
                service.TraceFlags    = TraceFlags.All;
                service.TraceEnabled  = true;
            }

            service.Credentials = new NetworkCredential(userData.EmailAddress, userData.Password);

            if (userData.AutodiscoverUrl == null)
            {
                Console.Write(string.Format("Using Autodiscover to find EWS URL for {0}. Please wait... ", userData.EmailAddress));

                service.AutodiscoverUrl(userData.EmailAddress, RedirectionUrlValidationCallback);
                userData.AutodiscoverUrl = service.Url;

                Console.WriteLine("Autodiscover Complete");
            }
            else
            {
                service.Url = userData.AutodiscoverUrl;
            }

            return(service);
        }
        public static ExchangeService ConnectToService(Account account, ITraceListener listener, Action func = null, Uri autodiscoverUrl = null)
        {
            func?.Invoke();

            ExchangeService service = new ExchangeService(account.Version);

            if (listener != null)
            {
                service.TraceListener = listener;
                service.TraceFlags    = TraceFlags.All;
                service.TraceEnabled  = true;
            }

            service.Credentials = new NetworkCredential(account.EmailAddress, account.Password);

            if (autodiscoverUrl == null)
            {
                service.AutodiscoverUrl(account.EmailAddress, RedirectionUrlValidationCallback);
                // autodiscoverUrl = service.Url;
            }
            else
            {
                service.Url = autodiscoverUrl;
            }

            return(service);
        }
        public static ExchangeService ConnectToServiceWithImpersonation(
            IUserData userData,
            string impersonatedUserSMTPAddress,
            ITraceListener listener)
        {
            ExchangeService service = new ExchangeService(userData.Version);

            if (listener != null)
            {
                service.TraceListener = listener;
                service.TraceFlags    = TraceFlags.All;
                service.TraceEnabled  = true;
            }

            service.Credentials = new NetworkCredential(userData.EmailAddress, userData.Password);

            ImpersonatedUserId impersonatedUserId =
                new ImpersonatedUserId(ConnectingIdType.SmtpAddress, impersonatedUserSMTPAddress);

            service.ImpersonatedUserId = impersonatedUserId;

            if (userData.AutodiscoverUrl == null)
            {
                service.AutodiscoverUrl(userData.EmailAddress, RedirectionUrlValidationCallback);
                userData.AutodiscoverUrl = service.Url;
            }
            else
            {
                service.Url = userData.AutodiscoverUrl;
            }

            return(service);
        }
Beispiel #12
0
        private static ExchangeService GetExchangeServiceObject(ITraceListener listner)
        {
            string methodName = "GetExchangeServiceObject";

            try
            {
                ServicePointManager.ServerCertificateValidationCallback = CertificateValidationCallback;
                ExchangeService service = new ExchangeService
                {
                    Credentials      = new WebCredentials(Login, Password),
                    Url              = new Uri(Url),
                    PreferredCulture = GetCulture()
                };
                if (listner != null)
                {
                    service.TraceEnabled  = true;
                    service.TraceFlags    = TraceFlags.All;
                    service.TraceListener = listner;
                }

                return(service);
            }
            catch (Exception ex)
            {
                WriteLog(ex.Message);
            }

            return(null);
        }
Beispiel #13
0
        public static ExchangeService ConnectToService(IUserData userData, ITraceListener listener)
        {
            ExchangeService service = new ExchangeService(userData.Version);

            if (listener != null)
            {
                service.TraceListener = listener;
                service.TraceFlags = TraceFlags.All;
                service.TraceEnabled = true;
            }

            service.Credentials = new NetworkCredential(userData.EmailAddress, userData.Password);

            if (userData.AutodiscoverUrl == null)
            {
                Console.Write(string.Format("Using Autodiscover to find EWS URL for {0}. Please wait... ", userData.EmailAddress));

                service.AutodiscoverUrl(userData.EmailAddress, RedirectionUrlValidationCallback);
                userData.AutodiscoverUrl = service.Url;

                Console.WriteLine("Autodiscover Complete");
            }
            else
            {
                service.Url = userData.AutodiscoverUrl;
            }

            return service;
        }
Beispiel #14
0
 public TestTracer(ITraceListener traceListener, IStepFormatter stepFormatter, IStepDefinitionSkeletonProvider stepDefinitionSkeletonProvider, RuntimeConfiguration runtimeConfiguration)
 {
     this.traceListener = traceListener;
     this.stepFormatter = stepFormatter;
     this.stepDefinitionSkeletonProvider = stepDefinitionSkeletonProvider;
     this.runtimeConfiguration = runtimeConfiguration;
 }
Beispiel #15
0
        public static ExchangeService ConnectToService(IUserData userData, ITraceListener listener)
        {
            ExchangeService service = new ExchangeService(userData.Version);

            if (listener != null)
            {
                service.TraceListener = listener;
                service.TraceFlags    = TraceFlags.All;
                service.TraceEnabled  = true;
            }

            service.Credentials = new NetworkCredential(userData.EmailAddress, userData.Password);

            if (userData.AutodiscoverUrl == null)
            {
                service.AutodiscoverUrl(userData.EmailAddress, RedirectionUrlValidationCallback);
                userData.AutodiscoverUrl = service.Url;
            }
            else
            {
                service.Url = userData.AutodiscoverUrl;
            }

            return(service);
        }
        //private string _lastKnownAutodiscoverUrl = "";


        public Mailboxes(ClassLogger Logger, ITraceListener TraceListener = null, Auth.CredentialHandler CredentialHandler = null)
        {
            _logger            = Logger;
            _credentialHandler = CredentialHandler;
            _mailboxes         = new Dictionary <string, MailboxInfo>();
            _traceListener     = TraceListener;
            CreateAutodiscoverService();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="TestProjectTestTracerWrapper"/> class.
 /// </summary>
 /// <param name="traceListener">Two.</param>
 /// <param name="stepFormatter">Three.</param>
 /// <param name="stepDefinitionSkeletonProvider">Four.</param>
 /// <param name="specFlowConfiguration">Five.</param>
 public TestProjectTestTracerWrapper(
     ITraceListener traceListener,
     IStepFormatter stepFormatter,
     IStepDefinitionSkeletonProvider stepDefinitionSkeletonProvider,
     SpecFlowConfiguration specFlowConfiguration)
     : base(traceListener, stepFormatter, stepDefinitionSkeletonProvider, specFlowConfiguration)
 {
 }
 public static void AddListener(ITraceListener listener)
 {
     if (_listeners.Contains(listener))
     {
         return;
     }
     _listeners.Add(listener);
 }
Beispiel #19
0
 /// <summary>
 /// add listener
 /// </summary>
 /// <param name="listener"></param>
 /// <exception cref="ArgumentNullException">listener is null</exception>
 static public void AddListener(ITraceListener listener)
 {
     if (listener == null)
     {
         throw new ArgumentNullException("listener");
     }
     _list.Add(listener);
 }
Beispiel #20
0
 public TestResultNotifier(IBrowserHost browser, IBrowserStackService browserStackService,
                           ITraceListener traceListener, IConfigurationProvider configurationProvider)
 {
     _browser               = browser;
     _browserStackService   = browserStackService;
     _traceListener         = traceListener;
     _configurationProvider = configurationProvider;
 }
Beispiel #21
0
 public void SetUp()
 {
     _browser               = Substitute.For <IBrowserHost>();
     _browserStackService   = Substitute.For <IBrowserStackService>();
     _traceListener         = Substitute.For <ITraceListener>();
     _configurationProvider = Substitute.For <IConfigurationProvider>();
     _sut = Substitute.ForPartsOf <TestResultNotifier>(_browser, _browserStackService, _traceListener, _configurationProvider);
 }
Beispiel #22
0
 public Builder(Options options, AppLocations appLocations, IBuilderEvent builderEvent)
 {
     Log = new List<string>();
     Counters = new List<string>();
     traceListener = new BuilderEventListener(this);
     Options = options;
     AppLocations = appLocations;
     BuilderEvent = builderEvent;
 }
Beispiel #23
0
 public Builder(Options options, AppLocations appLocations, IBuilderEvent builderEvent)
 {
     Log           = new List <string>();
     Counters      = new List <string>();
     traceListener = new BuilderEventListener(this);
     Options       = options;
     AppLocations  = appLocations;
     BuilderEvent  = builderEvent;
 }
Beispiel #24
0
        protected override void DoExecute()
        {
            SpecFlowProject specFlowProject = MsBuildProjectReader.LoadSpecFlowProjectFromMsBuild(ProjectPath);

            ITraceListener traceListener  = VerboseOutput ? (ITraceListener) new TextWriterTraceListener(GetMessageWriter(MessageImportance.High), "SpecFlow: ") : new NullListener();
            BatchGenerator batchGenerator = new MsBuildBatchGenerator(traceListener, new TestGeneratorFactory(), this);

            batchGenerator.ProcessProject(specFlowProject, ForceGeneration);
        }
        public static void WriteLine(this ITraceListener @this, string message)
        {
            if (@this == null)
            {
                return;
            }

            @this.Receive(message);
        }
        public static void WriteLine(this ITraceListener @this, string format, params object[] args)
        {
            if (@this == null)
            {
                return;
            }

            @this.Receive(string.Format(CultureInfo.InvariantCulture, format, args));
        }
Beispiel #27
0
 public GroupInfo(string Name, string PrimaryMailbox, string EWSUrl, ITraceListener TraceListener = null)
 {
     // initialise the group information
     _name           = Name;
     _primaryMailbox = PrimaryMailbox;
     _ewsUrl         = EWSUrl;
     _traceListener  = TraceListener;
     _mailboxes      = new List <String>();
     _mailboxes.Add(PrimaryMailbox);
 }
Beispiel #28
0
        public static void GenerateAll(
            [Required(Description = "Visual Studio Project File containing features")] string projectFile,
            [Optional(false, "force", "f")] bool forceGeneration,
            [Optional(false, "verbose", "v")] bool verboseOutput)
        {
            SpecFlowProject specFlowProject = MsBuildProjectReader.LoadSpecFlowProjectFromMsBuild(projectFile);
            ITraceListener  traceListener   = verboseOutput ? (ITraceListener) new TextWriterTraceListener(Console.Out) : new NullListener();
            var             batchGenerator  = new BatchGenerator(traceListener, new TestGeneratorFactory());

            batchGenerator.ProcessProject(specFlowProject, forceGeneration);
        }
Beispiel #29
0
        public MainWindowViewModel(IDiscovery discovery, ITraceListener traceListener)
        {
            _discovery     = discovery;
            _traceListener = traceListener;

            Text = "Welcome to the analysis viewer. This tool is used to demonstrate how different analyzers process text into tokens. You can edit this text to try different input such as numbers like 23231.23 or characters ([email protected]). Once happy, select an Analyzer from the list of analyzers found on the current assemblies path and then hit the Analyze button. The tokens produced are shown below and when you select them the right panel shows their attributes, and the corresponding span in the original text is highlighted.";

            TokenChangedCommand = new DelegateCommand(OnTokenChanging);
            AnalyzeCommand      = new DelegateCommand <IAnalyzer>(OnAnalyzing);
            Analyzers           = new ObservableCollection <IAnalyzer>();
            Tokens = new ObservableCollection <IToken>();

            Initialize();
        }
Beispiel #30
0
        protected virtual void LoadPlugin(
            string pluginPath,
            IRuntimePluginLoader pluginLoader,
            RuntimePluginEvents runtimePluginEvents,
            UnitTestProviderConfiguration unitTestProviderConfigration,
            ITraceListener traceListener,
            bool traceMissingPluginAttribute)
        {
            traceListener.WriteToolOutput($"Loading plugin {pluginPath}");

            var plugin = pluginLoader.LoadPlugin(pluginPath, traceListener, traceMissingPluginAttribute);
            var runtimePluginParameters = new RuntimePluginParameters();

            plugin?.Initialize(runtimePluginEvents, runtimePluginParameters, unitTestProviderConfigration);
        }
 /// <summary>
 /// Adds the arguement traceListener object to System.Diagnostics.TraceListenerCollection.
 /// </summary>
 /// <param name="traceListener">The trace listener instance.</param>
 public void Add(ITraceListener traceListener)
 {
     try
     {
         Trace.Listeners.Add(traceListener as TextWriterTraceListener);
     }
     catch (Exception ex)
     {
         // Catch exceptions if the configuration file is invalid and allow a stack
         // trace to show the error on the test method instead of here.
         if (!(ex.InnerException is System.Configuration.ConfigurationErrorsException))
         {
             throw;
         }
     }
 }
Beispiel #32
0
        public static void GenerateAll(GenerateAllOptions parameters)
        {
            if (parameters.RequestDebuggerToAttach)
            {
                Debugger.Launch();
            }

            ITraceListener traceListener = parameters.VerboseOutput ? (ITraceListener) new TextWriterTraceListener(Console.Out) : new NullListener();

            SpecFlowProject specFlowProject = MsBuildProjectReader.LoadSpecFlowProjectFromMsBuild(Path.GetFullPath(parameters.ProjectFile));
            var             batchGenerator  = new BatchGenerator(traceListener, new TestGeneratorFactory());

            batchGenerator.OnError += BatchGenerator_OnError;

            batchGenerator.ProcessProject(specFlowProject, parameters.ForceGeneration);
        }
        static void Main(string[] args)
        {
            OptionSet p = initOptions(args);

            if (File.Exists(logfile))
            {
                File.Delete(logfile);
            }
            w = File.AppendText(logfile);

            try
            {
                logTrace = new Listener(File.AppendText(logfile + ".trace"));
                logOptions(args);
                initialize(p);



                Log("Autodiscover URL " + service.Url);
                if (parallelUsers)
                {
                    Parallel.ForEach(users, processCalendar);
                }
                else
                {
                    for (int i = 0; i < users.Length; i++)
                    {
                        if (users[i] == "")
                        {
                            LogError("Error while parsing input in line " + i);
                            LogErrorLine("Expected a valid SMTP address but found ''", "ErrUnexpextedInput");
                            continue;
                        }
                        processCalendar(users[i]);
                    }
                }
                Log("Processed a total of " + Program.total + " appointments in " + users.Length + " calendars.");
                LogLine("Logfile at: " + logfile);

                exit();
            }
            catch (Exception e)
            {
                LogError("Unexpected Error");
                LogErrorLine(e.Message, "Error");
            }
        }
Beispiel #34
0
 public Mailboxes(WebCredentials AutodiscoverCredentials, ClassLogger Logger, ITraceListener TraceListener = null)
 {
     _logger       = Logger;
     _mailboxes    = new Dictionary <string, MailboxInfo>();
     _autodiscover = new AutodiscoverService(ExchangeVersion.Exchange2013);  // Minimum version we need is 2013
     _autodiscover.RedirectionUrlValidationCallback = RedirectionCallback;
     if (TraceListener != null)
     {
         _autodiscover.TraceListener = TraceListener;
         _autodiscover.TraceFlags    = TraceFlags.All;
         _autodiscover.TraceEnabled  = true;
     }
     if (!(AutodiscoverCredentials == null))
     {
         _autodiscover.Credentials = AutodiscoverCredentials;
     }
 }
Beispiel #35
0
        public IRuntimePlugin LoadPlugin(string pluginAssemblyName, ITraceListener traceListener, bool traceMissingPluginAttribute)
        {
            Assembly assembly;

            try
            {
#if NETSTANDARD
                assembly = PluginAssemblyResolver.Load(pluginAssemblyName);
#else
                assembly = Assembly.LoadFrom(pluginAssemblyName);
#endif
            }
            catch (Exception ex)
            {
                throw new SpecFlowException(string.Format("Unable to load plugin: {0}. Please check https://go.specflow.org/doc-plugins for details.", pluginAssemblyName), ex);
            }

            var pluginAttribute = (RuntimePluginAttribute)Attribute.GetCustomAttribute(assembly, typeof(RuntimePluginAttribute));
            if (pluginAttribute == null)
            {
                if (traceMissingPluginAttribute)
                {
                    traceListener.WriteToolOutput(string.Format("Missing [assembly:RuntimePlugin] attribute in {0}. Please check https://go.specflow.org/doc-plugins for details.", assembly.FullName));
                }

                return(null);
            }

            if (!typeof(IRuntimePlugin).IsAssignableFrom(pluginAttribute.PluginType))
            {
                throw new SpecFlowException(string.Format("Invalid plugin attribute in {0}. Plugin type must implement IRuntimePlugin. Please check https://go.specflow.org/doc-plugins for details.", assembly.FullName));
            }

            IRuntimePlugin plugin;
            try
            {
                plugin = (IRuntimePlugin)Activator.CreateInstance(pluginAttribute.PluginType);
            }
            catch (Exception ex)
            {
                throw new SpecFlowException(string.Format("Invalid plugin in {0}. Plugin must have a default constructor that does not throw exception. Please check https://go.specflow.org/doc-plugins for details.", assembly.FullName), ex);
            }

            return(plugin);
        }
Beispiel #36
0
        private void Dispose(bool disposing)
        {
            if (disposing)
            {
                Logger.OnLogMessage -= this.redirectLoggerOut.WriteLine;
                Logger.OnLogMessage -= this.redirectStdErr.WriteLine;

                this.redirectLoggerOut.Dispose();
                this.redirectStdErr.Dispose();

                if (this.captureDebugTraces)
                {
                    try
                    {
                        if (this.traceListener != null)
                        {
                            this.traceListenerManager.Remove(this.traceListener);
                        }

                        // Restore the previous LogMessageListener's TraceListener (if there was one)
                        if (this.previousRedirector != null && this.previousRedirector.traceListener != null)
                        {
                            this.traceListenerManager.Add(this.previousRedirector.traceListener);
                        }
                    }
                    catch (Exception e)
                    {
                        // Catch all exceptions since Dispose should not throw.
                        PlatformServiceProvider.Instance.AdapterTraceLogger.LogError(
                            "ConsoleOutputRedirector.Dispose threw exception: {0}",
                            e);
                    }

                    if (this.traceListener != null)
                    {
                        // Dispose trace manager and listeners
                        this.traceListenerManager.Dispose(this.traceListener);
                        this.traceListenerManager = null;
                        this.traceListener        = null;
                    }
                }

                activeRedirector = this.previousRedirector;
            }
        }
 public MsBuildBatchGenerator(ITraceListener traceListener, ITestGeneratorFactory testGeneratorFactory, GeneratorTaskBase task) : base(traceListener, testGeneratorFactory)
 {
     this.task = task;
 }
Beispiel #38
0
 public TestTracer()
 {
     this.traceListener = ObjectContainer.TraceListener;
     this.stepDefinitionSkeletonProvider = ObjectContainer.StepDefinitionSkeletonProvider;
     this.stepFormatter = ObjectContainer.StepFormatter;
 }
 public BasicInternalTrace(ITraceListener instructionLogListener, ICompilerEventListener compilerStatusListener)
 {
     this.instructionLogListener = instructionLogListener;
     this.compilerStatusListener = compilerStatusListener;
 }
 public BasicInternalTrace()
 {
     instructionLogListener = new DebugInstructionTraceListener();
     compilerStatusListener = new BasicCompilerEventListener();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ExchangeServiceBase"/> class.
 /// </summary>
 /// <param name="service">The other service.</param>
 /// <param name="requestedServerVersion">The requested server version.</param>
 internal ExchangeServiceBase(ExchangeServiceBase service, ExchangeVersion requestedServerVersion)
     : this(requestedServerVersion)
 {
     this.useDefaultCredentials = service.useDefaultCredentials;
     this.credentials = service.credentials;
     this.traceEnabled = service.traceEnabled;
     this.traceListener = service.traceListener;
     this.traceFlags = service.traceFlags;
     this.timeout = service.timeout;
     this.preAuthenticate = service.preAuthenticate;
     this.userAgent = service.userAgent;
     this.acceptGzipEncoding = service.acceptGzipEncoding;
     this.keepAlive = service.keepAlive;
     this.connectionGroupName = service.connectionGroupName;
     this.timeZone = service.timeZone;
     this.httpHeaders = service.httpHeaders;
     this.ewsHttpWebRequestFactory = service.ewsHttpWebRequestFactory;
 }
Beispiel #42
0
 public TestTracer(ITraceListener traceListener, IStepFormatter stepFormatter, IDictionary<ProgrammingLanguage, IStepDefinitionSkeletonProvider> stepDefinitionSkeletonProviders)
 {
     this.traceListener = traceListener;
     this.stepDefinitionSkeletonProviders = stepDefinitionSkeletonProviders;
     this.stepFormatter = stepFormatter;
 }
 public TraceListenerQueue(ITraceListener traceListener, ITestRunnerManager testRunnerManager)
 {
     this.traceListener = traceListener;
     this.testRunnerManager = testRunnerManager;
     isThreadSafeTraceListener = traceListener is IThreadSafeTraceListener;
 }
Beispiel #44
0
 public BatchGenerator(ITraceListener traceListener, ITestGeneratorFactory testGeneratorFactory)
 {
     this.traceListener = traceListener;
     this.testGeneratorFactory = testGeneratorFactory;
 }
Beispiel #45
0
 public BasicInternalTrace()
 {
     traceListener = new DebugTraceListener();
     compilerEventListener = new BasicCompilerEventListener();
 }
Beispiel #46
0
 public ServerStatus(ITraceListener traceListener)
 {
     this.traceListener = traceListener;
 }
Beispiel #47
0
 public TestTracer()
 {
     this.traceListener = ObjectContainer.TraceListener;
     this.stepFormatter = ObjectContainer.StepFormatter;
 }
Beispiel #48
0
 public BasicInternalTrace(ITraceListener traceListener, ICompilerEventListener compilerEventListener)
 {
     this.traceListener = traceListener;
     this.compilerEventListener = compilerEventListener;
 }
Beispiel #49
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ProxyLogger"/> class.
 /// </summary>
 /// <param name="traceListener">The trace listener.</param>
 public ProxyLogger(ITraceListener traceListener)
 {
     this.traceListener = traceListener;
 }
Beispiel #50
0
 /// <summary>
 /// add listener
 /// </summary>
 /// <param name="listener"></param>
 /// <exception cref="ArgumentNullException">listener is null</exception>
 public static void AddListener(ITraceListener listener)
 {
     if (listener == null) throw new ArgumentNullException("listener");
     _list.Add(listener);
 }
Beispiel #51
-5
		private void DoListen(ITraceListener listener, TraceEntry entry)
		{
			if(listener == null)
				return;

			bool shouldTrace = true;

			try
			{
				if(listener.Filter != null)
					shouldTrace = listener.Filter.ShouldTrace(entry);
			}
			catch(Exception ex)
			{
				this.OnFailed(new FailureEventArgs(ex, listener.Filter));
			}

			try
			{
				if(shouldTrace)
					listener.OnTrace(entry);
			}
			catch(Exception ex)
			{
				this.OnFailed(new FailureEventArgs(ex, listener));
			}
		}