// Token: 0x0600086D RID: 2157 RVA: 0x0003AB14 File Offset: 0x00038D14
 public List <KeyValuePair <string, object> > LogAllData(MailboxSession mailboxSession, string parameters)
 {
     if (this.Exception != null)
     {
         SharingSyncAssistantLog.LogEntry(mailboxSession, "CalendarSyncAssistantHelper.ProcessFolder with parameter {0} hit the following exception: {1}", new object[]
         {
             parameters,
             this.Exception
         });
     }
     if (this.IsDeadlineExpired)
     {
         SharingSyncAssistantLog.LogEntry(mailboxSession, "Deadline expired before processing all folders. Processed {0}/{1} folders. MaxSyncTime: {2}", new object[]
         {
             this.NumOfFoldersActuallySynced,
             this.NumOfFoldersToSync,
             this.MaxTimeoutValue
         });
     }
     if (this.FolderDetailLoglines != null)
     {
         foreach (CalendarSyncFolderOperationLogEntry calendarSyncFolderOperationLogEntry in this.FolderDetailLoglines)
         {
             List <KeyValuePair <string, object> > list = calendarSyncFolderOperationLogEntry.FormatCustomData();
             AssistantsLog.LogFolderSyncOperationEvent(calendarSyncFolderOperationLogEntry.ActivityId, "CalendarSyncAssistant", list);
             this.AddExtendedProperty("FolderFullyProcessed", calendarSyncFolderOperationLogEntry.FolderType, calendarSyncFolderOperationLogEntry.FolderId, calendarSyncFolderOperationLogEntry.IsSyncSuccess);
             this.PostFolderDetailsToQuickLogs(mailboxSession, calendarSyncFolderOperationLogEntry, string.Join <KeyValuePair <string, object> >(";", list.ToArray()));
             if (calendarSyncFolderOperationLogEntry.SanitizedStackTraces != null && calendarSyncFolderOperationLogEntry.SanitizedStackTraces.Count > 0)
             {
                 foreach (List <KeyValuePair <string, object> > customData in calendarSyncFolderOperationLogEntry.SanitizedStackTraces)
                 {
                     AssistantsLog.LogFolderSyncExceptionEvent(calendarSyncFolderOperationLogEntry.ActivityId, "CalendarSyncAssistant", customData);
                 }
             }
         }
     }
     return(this.FormatCustomData());
 }
 // Token: 0x0600086F RID: 2159 RVA: 0x0003ACC0 File Offset: 0x00038EC0
 private void PostFolderDetailsToQuickLogs(MailboxSession mailboxSession, CalendarSyncFolderOperationLogEntry folderOpLogEntry, string folderDetailsToLog)
 {
     if (folderOpLogEntry.FolderType == "UnknownFolderType")
     {
         InternetCalendarLog.LogEntry(mailboxSession, string.Format("CalendarSyncAssistantHelper.ProcessFolder Couldn't find a corresponding SynchronizableFolderType object for folder id {0}.", folderOpLogEntry.FolderId));
         return;
     }
     if (folderOpLogEntry.FolderType == "InternetCalendar")
     {
         if (folderOpLogEntry.SubscriptionData == null)
         {
             string entry = string.Format("InternetCalendarType.Synchronize couldn't find subscription data for folder {0} with id {1} for mailbox {2}.", folderOpLogEntry.DisplayName, folderOpLogEntry.FolderId, mailboxSession.DisplayName);
             InternetCalendarLog.LogEntry(mailboxSession, entry);
         }
         InternetCalendarLog.LogEntry(mailboxSession, string.Format("Sync Details for InternetCalendar subscription {0}, folder {1} with id {2} are {3}.", new object[]
         {
             folderOpLogEntry.SubscriptionData,
             folderOpLogEntry.DisplayName,
             folderOpLogEntry.FolderId,
             folderDetailsToLog
         }));
     }
     if (folderOpLogEntry.IsDeadlineExpired)
     {
         SharingSyncAssistantLog.LogEntry(mailboxSession, "Deadline expired before processing folder {0}. MaxSyncTime: {1}", new object[]
         {
             folderOpLogEntry.DisplayName,
             SynchronizableFolderType.MaxSyncTimePerFolder
         });
     }
     SharingSyncAssistantLog.LogEntry(mailboxSession, "Sync Details for folder {0} are {1}", new object[]
     {
         folderOpLogEntry.DisplayName,
         folderDetailsToLog
     });
 }
        // Token: 0x060007C4 RID: 1988 RVA: 0x00038530 File Offset: 0x00036730
        protected override void InvokeInternal(InvokeArgs invokeArgs, List <KeyValuePair <string, object> > customDataToLog)
        {
            DateTime       utcNow         = DateTime.UtcNow;
            MailboxSession mailboxSession = invokeArgs.StoreSession as MailboxSession;

            if (mailboxSession == null)
            {
                return;
            }
            CalendarSyncLogEntry calendarSyncLogEntry = new CalendarSyncLogEntry
            {
                ProcessingStartTime = utcNow,
                IsOnDemandJob       = false,
                MailboxGuid         = mailboxSession.MailboxGuid,
                IsArchive           = mailboxSession.MailboxOwner.MailboxInfo.IsArchive,
                TenantGuid          = mailboxSession.MailboxOwner.MailboxInfo.OrganizationId.GetTenantGuid(),
                MailboxType         = mailboxSession.MailboxOwner.RecipientTypeDetails
            };

            this.ThrowIfShuttingDown(mailboxSession, calendarSyncLogEntry, customDataToLog);
            try
            {
                CalendarSyncAssistant.Tracer.TraceDebug <object, string>((long)this.GetHashCode(), "{0}: CalendarSyncAssistant.InvokeInternal: starting to process mailbox: {1}.", TraceContext.Get(), mailboxSession.MailboxOwner.MailboxInfo.DisplayName);
                ExTimeZone userTimeZone = TimeZoneHelper.GetUserTimeZone(mailboxSession);
                if (userTimeZone != null)
                {
                    mailboxSession.ExTimeZone = userTimeZone;
                    CalendarSyncAssistant.Tracer.TraceDebug <object, ExTimeZone>((long)this.GetHashCode(), "{0}: CalendarSyncAssistant.InvokeInternal: changed session to user configuration time zone: {1}.", TraceContext.Get(), userTimeZone);
                }
                else
                {
                    CalendarSyncAssistant.Tracer.TraceDebug <object, ExTimeZone>((long)this.GetHashCode(), "{0}: CalendarSyncAssistant.InvokeInternal: failed to read user configuration time zone. Use time zone:{1}.", TraceContext.Get(), mailboxSession.ExTimeZone);
                    SharingSyncAssistantLog.LogEntry(mailboxSession, "Failed to read user configuration time zone. Use default session time zone:{0}", new object[]
                    {
                        mailboxSession.ExTimeZone
                    });
                }
                if (string.IsNullOrEmpty(invokeArgs.Parameters))
                {
                    this.CalendarSyncAssistantHelper.ProcessMailbox(mailboxSession, invokeArgs.TimePerTask, invokeArgs.ActivityId, calendarSyncLogEntry);
                }
                else
                {
                    if (this.PerformanceCounters != null)
                    {
                        this.PerformanceCounters.OnDemandRequests.Increment();
                    }
                    calendarSyncLogEntry.IsOnDemandJob = true;
                    this.CalendarSyncAssistantHelper.ProcessFolder(mailboxSession, invokeArgs.Parameters, calendarSyncLogEntry);
                }
                CalendarSyncAssistant.Tracer.TraceDebug <object, string>((long)this.GetHashCode(), "{0}: CalendarSyncAssistant.InvokeInternal: successfully processed mailbox: {1}.", TraceContext.Get(), mailboxSession.MailboxOwner.MailboxInfo.DisplayName);
            }
            catch (Exception ex)
            {
                if (ex is AIException && ex.InnerException != null)
                {
                    calendarSyncLogEntry.ExceptionType = ex.InnerException.GetType().FullName;
                }
                else
                {
                    calendarSyncLogEntry.ExceptionType = ex.GetType().FullName;
                }
                throw;
            }
            finally
            {
                calendarSyncLogEntry.ProcessingEndTime   = DateTime.UtcNow;
                calendarSyncLogEntry.TotalProcessingTime = (long)(calendarSyncLogEntry.ProcessingEndTime - utcNow).TotalMilliseconds;
                customDataToLog.AddRange(calendarSyncLogEntry.LogAllData(mailboxSession, invokeArgs.Parameters));
            }
        }