Пример #1
0
 public override void BeginInvoke(TaskCompleteCallback callback)
 {
     base.BeginInvoke(callback);
     this.queryItems        = AutoDiscoverQueryItem.CreateAutoDiscoverQueryItems(base.Application, base.QueryList, this.targetForestConfiguration.AutoDiscoverUrl);
     this.autoDiscoverQuery = new AutoDiscoverQueryInternal(base.Application, base.ClientContext, base.RequestLogger, this.targetForestConfiguration, this.queryItems, new CreateAutoDiscoverRequestDelegate(AutoDiscoverRequestXmlByUser.Create), base.QueryList);
     this.autoDiscoverQuery.BeginInvoke(new TaskCompleteCallback(this.Complete1));
 }
 public override void BeginInvoke(TaskCompleteCallback callback)
 {
     base.BeginInvoke(callback);
     this.queryItems        = AutoDiscoverQueryItem.CreateAutoDiscoverQueryItems(base.Application, base.QueryList, this.targetForestConfiguration.AutoDiscoverUrl);
     this.autoDiscoverQuery = new AutoDiscoverQueryInternal(base.Application, base.ClientContext, base.RequestLogger, this.targetForestConfiguration, this.queryItems, this.createAutoDiscoverRequest, base.QueryList);
     this.requestTimer      = Stopwatch.StartNew();
     this.autoDiscoverQuery.BeginInvoke(new TaskCompleteCallback(this.Complete1));
 }
Пример #3
0
        public override void BeginInvoke(TaskCompleteCallback callback)
        {
            base.BeginInvoke(callback);
            ProxyAuthenticator proxyAuthenticator = ProxyAuthenticator.Create(OAuthCredentialsFactory.Create(base.ClientContext as InternalClientContext, base.RequestLogger), base.ClientContext.MessageId, false);

            this.proxyWebRequest = new ProxyWebRequest(base.Application, base.ClientContext, RequestType.FederatedCrossForest, base.RequestLogger, base.QueryList, TargetServerVersion.Unknown, proxyAuthenticator, this.webServiceUri, this.webServiceUri.Source);
            this.proxyWebRequest.BeginInvoke(new TaskCompleteCallback(this.CompleteWebRequest));
        }
        public override void BeginInvoke(TaskCompleteCallback callback)
        {
            base.BeginInvoke(callback);
            Stopwatch stopwatch = Stopwatch.StartNew();

            this.externalAuthenticationRequest.BeginInvoke(new TaskCompleteCallback(this.CompleteAuthenticator));
            stopwatch.Stop();
            base.QueryList.LogLatency("EPRBI", stopwatch.ElapsedMilliseconds);
        }
Пример #5
0
 public override void BeginInvoke(TaskCompleteCallback callback)
 {
     base.BeginInvoke(callback);
     for (int i = 0; i < base.Tasks.Count; i++)
     {
         AsyncTask asyncTask = base.Tasks[i];
         asyncTask.BeginInvoke(new TaskCompleteCallback(this.CompleteChildTask));
     }
 }
Пример #6
0
        public override void BeginInvoke(TaskCompleteCallback callback)
        {
            base.BeginInvoke(callback);
            ProxyAuthenticator proxyAuthenticator = ProxyAuthenticator.Create(OAuthCredentialsFactory.CreateAsApp(base.ClientContext as InternalClientContext, base.RequestLogger), base.ClientContext.MessageId, true);

            this.queryItems        = AutoDiscoverQueryItem.CreateAutoDiscoverQueryItems(base.Application, base.QueryList, this.autoDiscoverUrl);
            this.autoDiscoverQuery = new AutoDiscoverQueryExternalByOAuth(base.Application, base.ClientContext, base.RequestLogger, this.autoDiscoverUrl, proxyAuthenticator, this.queryItems, this.createAutoDiscoverRequest, base.QueryList);
            this.autoDiscoverQuery.BeginInvoke(new TaskCompleteCallback(this.Complete1));
        }
Пример #7
0
 public virtual void BeginInvoke(TaskCompleteCallback callback)
 {
     AsyncTask.Tracer.TraceDebug <object, AsyncTask>((long)this.GetHashCode(), "{0}: BeginInvoke: {1}", TraceContext.Get(), this);
     if (this.taskState != TaskState.NotStarted)
     {
         throw new InvalidOperationException();
     }
     this.taskState = TaskState.Running;
     this.callback  = callback;
 }
Пример #8
0
 public override void BeginInvoke(TaskCompleteCallback callback)
 {
     base.BeginInvoke(callback);
     this.requests = new AutoDiscoverRequest[base.EmailAddresses.Length];
     for (int i = 0; i < base.EmailAddresses.Length; i++)
     {
         this.requests[i] = this.GetRequest(base.EmailAddresses[i]);
     }
     this.parallel = new AsyncTaskParallel(this.requests);
     this.parallel.BeginInvoke(new TaskCompleteCallback(this.CompleteRequest));
 }
Пример #9
0
 public override void BeginInvoke(TaskCompleteCallback callback)
 {
     base.BeginInvoke(callback);
     GetFolderAndProxyRequest.GetFolderRequestTracer.TraceDebug <object, int, Uri>((long)this.GetHashCode(), "{0}: Dispatching GetFolder request for {1} mailboxes to Url {2}.", TraceContext.Get(), base.QueryList.Count, this.webServiceUri.Uri);
     this.getFolderRequests = new GetFolderRequest[base.QueryList.Count];
     for (int i = 0; i < base.QueryList.Count; i++)
     {
         BaseQuery query = base.QueryList[i];
         this.getFolderRequests[i] = new GetFolderRequest(base.Application, (InternalClientContext)base.ClientContext, base.RequestType, base.RequestLogger, query, this.webServiceUri.Uri);
     }
     this.parallel = new AsyncTaskParallel(this.getFolderRequests);
     this.parallel.BeginInvoke(new TaskCompleteCallback(this.Complete1));
 }
Пример #10
0
 private void BeginInvokeInternal(TaskCompleteCallback callback)
 {
     base.BeginInvoke(callback);
     try
     {
         GrayException.MapAndReportGrayExceptions(delegate()
         {
             try
             {
                 this.asyncResult = this.BeginInvoke();
             }
             catch (SoapException exception)
             {
                 this.HandleException(exception);
             }
             catch (UriFormatException exception2)
             {
                 this.HandleException(exception2);
             }
             catch (WebException exception3)
             {
                 this.HandleException(exception3);
             }
             catch (IOException ex2)
             {
                 SocketException ex3 = ex2.InnerException as SocketException;
                 if (ex3 == null)
                 {
                     ExWatson.SendReport(ex2, ReportOptions.None, null);
                     this.HandleException(ex2);
                 }
                 else
                 {
                     this.HandleException(ex3);
                 }
             }
             catch (LocalizedException exception4)
             {
                 this.HandleException(exception4);
             }
         });
     }
     catch (GrayException ex)
     {
         this.HandleException(ex.InnerException);
     }
     if (this.asyncResult == null && this.CompleteAtomically())
     {
         this.Complete();
     }
 }
Пример #11
0
 public sealed override void BeginInvoke(TaskCompleteCallback callback)
 {
     if (this.ShouldCallBeginInvokeByNewThread)
     {
         ThreadPool.QueueUserWorkItem(delegate(object dummy)
         {
             ThreadContext.SetWithExceptionHandling(this.traceLabel + "ByNewThread", this.Application.Worker, this.ClientContext, this.RequestLogger, delegate
             {
                 this.BeginInvokeInternal(callback);
             });
         });
         return;
     }
     this.BeginInvokeInternal(callback);
 }
        public override void BeginInvoke(TaskCompleteCallback callback)
        {
            base.BeginInvoke(callback);
            this.parallel = new AsyncTaskParallel(new AsyncTask[]
            {
                this.autoDiscoverExternalAuthenticationRequest,
                this.webProxyExternalAuthenticationRequest
            });
            this.requestTimer = Stopwatch.StartNew();
            Stopwatch stopwatch = Stopwatch.StartNew();

            this.parallel.BeginInvoke(new TaskCompleteCallback(this.Complete1));
            stopwatch.Stop();
            base.QueryList.LogLatency("EPWRADBI", stopwatch.ElapsedMilliseconds);
        }
Пример #13
0
 public override void BeginInvoke(TaskCompleteCallback callback)
 {
     base.BeginInvoke(callback);
     this.localRequestStopwatch = Stopwatch.StartNew();
     this.pendingItems          = base.QueryList.Count;
     foreach (BaseQuery baseQuery in ((IEnumerable <BaseQuery>)base.QueryList))
     {
         baseQuery.Target = baseQuery.ExchangePrincipal.MailboxInfo.GetDatabaseGuid().ToString();
         this.threadPool.Add(baseQuery);
     }
     LocalRequest.RequestRoutingTracer.TraceDebug((long)this.GetHashCode(), "{0}: Starting the threads in the thread pool", new object[]
     {
         TraceContext.Get()
     });
     this.threadPool.Start();
 }
Пример #14
0
 public override void BeginInvoke(TaskCompleteCallback callback)
 {
     base.BeginInvoke(callback);
     this.queryListDictionary = null;
     if (this.requests.Count == 0)
     {
         BaseRequestDispatcher.RequestRoutingTracer.TraceDebug((long)this.GetHashCode(), "{0}: No requests to dispatch.", new object[]
         {
             TraceContext.Get()
         });
         base.Complete();
         return;
     }
     BaseRequestDispatcher.RequestRoutingTracer.TraceDebug <object, int>((long)this.GetHashCode(), "{0}: dispatching {1} requests.", TraceContext.Get(), this.requests.Count);
     this.parallel = new AsyncTaskParallel(this.requests.ToArray());
     this.parallel.BeginInvoke(new TaskCompleteCallback(this.Complete));
 }
Пример #15
0
        public override void BeginInvoke(TaskCompleteCallback callback)
        {
            base.BeginInvoke(callback);
            int num = this.redirectionDepth;

            if (num == 0)
            {
                this.serverRequestId = Microsoft.Exchange.Diagnostics.Trace.TraceCasStart(CasTraceEventType.AutoDiscover);
            }
            this.timeTaken      = Stopwatch.StartNew();
            this.pendingRequest = this.createAutoDiscoverRequest(this.application, this.clientContext, this.requestLogger, this.autoDiscoverUrl, this.authenticator, this.emailAddresses, UriSource.EmailDomain, this.autodiscoverType);
            this.pendingRequest.BeginInvoke(new TaskCompleteCallback(this.CompleteRequest));
            if (this.queryList != null && this.queryList.Count > 0)
            {
                this.queryList.LogLatency("ADQBI_" + num, this.timeTaken.ElapsedMilliseconds);
            }
        }
 public override void BeginInvoke(TaskCompleteCallback callback)
 {
     base.BeginInvoke(callback);
     this.stopwatch = Stopwatch.StartNew();
     try
     {
         DelegationTokenRequest request = new DelegationTokenRequest
         {
             FederatedIdentity = this.user.GetFederatedIdentity(),
             EmailAddress      = this.GetFederatedSmtpAddress().ToString(),
             Target            = this.target,
             Offer             = this.offer
         };
         this.asyncResult = this.securityTokenService.BeginIssueToken(request, new AsyncCallback(this.Complete), null);
     }
     catch (LocalizedException ex)
     {
         this.exception = ex;
         base.Complete();
     }
 }
Пример #17
0
 public override void BeginInvoke(TaskCompleteCallback callback)
 {
     base.BeginInvoke(callback);
     this.domainSoapAutoDiscoverRequest = new DomainSoapAutoDiscoverRequest(base.Application, base.ClientContext, base.RequestLogger, base.Authenticator, base.TargetUri, base.EmailAddresses, base.AutodiscoverType);
     this.domainSoapAutoDiscoverRequest.BeginInvoke(new TaskCompleteCallback(this.CompleteRequest));
 }
 public override void BeginInvoke(TaskCompleteCallback callback)
 {
     base.BeginInvoke(callback);
     this.BeginInvokeRequest();
 }