private void ProcessGetChanges()
        {
            DeltaSyncSummary deltaSyncSummary = new DeltaSyncSummary();
            List <IEnumerable <DeltaSyncBatchResults> > list = deltaSyncSummary.Samples as List <IEnumerable <DeltaSyncBatchResults> >;

            this.FindTheRightCookie();
            ExProgressRecord exProgressRecord  = new ExProgressRecord(1, new LocalizedString("Delta Sync"), new LocalizedString("Sync Call"));
            ExProgressRecord exProgressRecord2 = new ExProgressRecord(2, new LocalizedString("Sync Call"), new LocalizedString("GetChanges"));

            exProgressRecord2.ParentActivityId = exProgressRecord.ActivityId;
            for (int i = 0; i < this.SampleCountForStatistics; i++)
            {
                exProgressRecord.CurrentOperation = Strings.GetMsoDiagnosticsProgressIteration(i + 1, this.SampleCountForStatistics);
                exProgressRecord.PercentComplete  = i * 100 / this.SampleCountForStatistics;
                exProgressRecord.RecordType       = ProgressRecordType.Processing;
                base.WriteProgress(exProgressRecord);
                byte[] lastCookie = this.Cookie;
                List <DeltaSyncBatchResults> list2 = new List <DeltaSyncBatchResults>();
                list.Add(list2);
                for (int j = 0; j < this.MaxNumberOfBatches; j++)
                {
                    exProgressRecord2.CurrentOperation = Strings.GetMsoDiagnosticsProgressBatch(j + 1, this.MaxNumberOfBatches);
                    exProgressRecord2.PercentComplete  = j * 100 / this.MaxNumberOfBatches;
                    exProgressRecord2.RecordType       = ProgressRecordType.Processing;
                    base.WriteProgress(exProgressRecord2);
                    ExDateTime         now              = ExDateTime.Now;
                    GetChangesResponse changes          = this.MsoSyncService.SyncProxy.GetChanges(new GetChangesRequest(lastCookie));
                    TimeSpan           responseTime     = ExDateTime.Now - now;
                    DirectoryChanges   getChangesResult = changes.GetChangesResult;
                    if (getChangesResult != null)
                    {
                        DeltaSyncBatchResults deltaSyncBatchResults = new DeltaSyncBatchResults(getChangesResult);
                        deltaSyncBatchResults.Stats.ResponseTime = responseTime;
                        deltaSyncBatchResults.LastCookie         = lastCookie;
                        deltaSyncBatchResults.RawResponse        = this.MsoSyncService.RawResponse;
                        deltaSyncBatchResults.CalculateStats();
                        list2.Add(deltaSyncBatchResults);
                        lastCookie = getChangesResult.NextCookie;
                    }
                    if (getChangesResult == null || !getChangesResult.More)
                    {
                        break;
                    }
                }
                if (list2.Last <DeltaSyncBatchResults>().More)
                {
                    this.WriteWarning(Strings.GetMsoDiagnosticsMoreDataIsAvailable);
                }
                exProgressRecord2.RecordType = ProgressRecordType.Completed;
                base.WriteProgress(exProgressRecord2);
            }
            exProgressRecord.RecordType = ProgressRecordType.Completed;
            base.WriteProgress(exProgressRecord);
            deltaSyncSummary.CalculateStats();
            base.WriteObject(deltaSyncSummary);
        }
 public void Calculate(DeltaSyncBatchResults deltaSyncBatch)
 {
     base.Calculate(deltaSyncBatch.Objects, deltaSyncBatch.Links);
     this.ContextCount = deltaSyncBatch.Contexts.Count <DirectoryContext>();
     if (DeltaSyncBatchStatistics.< Calculate > o__SiteContainer0.< > p__Site1 == null)
     {
         DeltaSyncBatchStatistics.< Calculate > o__SiteContainer0.< > p__Site1 = CallSite <Func <CallSite, object, SizeAndCountStatistics> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(SizeAndCountStatistics), typeof(DeltaSyncBatchStatistics)));
     }
     this.ContextSize = DeltaSyncBatchStatistics.< Calculate > o__SiteContainer0.< > p__Site1.Target(DeltaSyncBatchStatistics.< Calculate > o__SiteContainer0.< > p__Site1, SizeAndCountStatistics.Calculate(from o in deltaSyncBatch.Contexts
                                                                                                                                                                                                             select SyncBatchStatisticsBase.SerializedSize(o)));
     this.ContextsPerSecond     = (double)this.ContextCount / base.ResponseTime.TotalSeconds;
     this.ContextBytesPerSecond = (double)this.ContextSize.Sum / base.ResponseTime.TotalSeconds;
 }