Example #1
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;
        }
Example #2
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;
        }
Example #3
0
 public Builder(Options options, AppLocations appLocations, IBuilderEvent builderEvent)
     : base(options, appLocations)
 {
     Counters = new List<string>();
     traceListener = new BuilderEventListener(this);
     BuilderEvent = builderEvent;
 }
Example #4
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;
        }
Example #5
0
 public TestTracer(ITraceListener traceListener, IStepFormatter stepFormatter, IStepDefinitionSkeletonProvider stepDefinitionSkeletonProvider, RuntimeConfiguration runtimeConfiguration)
 {
     this.traceListener = traceListener;
     this.stepFormatter = stepFormatter;
     this.stepDefinitionSkeletonProvider = stepDefinitionSkeletonProvider;
     this.runtimeConfiguration = runtimeConfiguration;
 }
Example #6
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;
 }
Example #7
0
 public BasicInternalTrace(ITraceListener traceListener, ICompilerEventListener compilerEventListener)
 {
     this.traceListener = traceListener;
     this.compilerEventListener = compilerEventListener;
 }
Example #8
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;
 }
 public BasicInternalTrace()
 {
     instructionLogListener = new DebugInstructionTraceListener();
     compilerStatusListener = new BasicCompilerEventListener();
 }
 public BasicInternalTrace(ITraceListener instructionLogListener, ICompilerEventListener compilerStatusListener)
 {
     this.instructionLogListener = instructionLogListener;
     this.compilerStatusListener = compilerStatusListener;
 }
Example #11
0
		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));
			}
		}
Example #12
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);
 }
Example #13
0
 public TestTracer()
 {
     this.traceListener = ObjectContainer.TraceListener;
     this.stepDefinitionSkeletonProvider = ObjectContainer.StepDefinitionSkeletonProvider;
     this.stepFormatter = ObjectContainer.StepFormatter;
 }
Example #14
0
 public BatchGenerator(ITraceListener traceListener, ITestGeneratorFactory testGeneratorFactory)
 {
     this.traceListener = traceListener;
     this.testGeneratorFactory = testGeneratorFactory;
 }
Example #15
0
 public BasicInternalTrace()
 {
     traceListener = new DebugTraceListener();
     compilerEventListener = new BasicCompilerEventListener();
 }
Example #16
0
 public TestTracer(ITraceListener traceListener, IStepFormatter stepFormatter, IDictionary<ProgrammingLanguage, IStepDefinitionSkeletonProvider> stepDefinitionSkeletonProviders)
 {
     this.traceListener = traceListener;
     this.stepDefinitionSkeletonProviders = stepDefinitionSkeletonProviders;
     this.stepFormatter = stepFormatter;
 }
 /// <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;
 }
 public TraceListenerQueue(ITraceListener traceListener, ITestRunnerManager testRunnerManager)
 {
     this.traceListener = traceListener;
     this.testRunnerManager = testRunnerManager;
     isThreadSafeTraceListener = traceListener is IThreadSafeTraceListener;
 }
Example #19
0
 public MsBuildBatchGenerator(ITraceListener traceListener, ITestGeneratorFactory testGeneratorFactory, GeneratorTaskBase task) : base(traceListener, testGeneratorFactory)
 {
     this.task = task;
 }
Example #20
0
 public TestTracer()
 {
     this.traceListener = ObjectContainer.TraceListener;
     this.stepFormatter = ObjectContainer.StepFormatter;
 }
Example #21
0
 public ServerStatus(ITraceListener traceListener)
 {
     this.traceListener = traceListener;
 }