// Token: 0x06000F2C RID: 3884 RVA: 0x0005A9C0 File Offset: 0x00058BC0
        public override void Invoke()
        {
            string text = null;

            if (!this.IsSplitEnabled(out text))
            {
                if (text != null)
                {
                    this.logger.LogEvent(LogEventType.Verbose, string.Format("PublicFolderSplitProcessor::{0}::Invoke - Split processing disabled for mailbox {1} for reason {2}", this.GetHashCode(), this.publicFolderSession.DisplayAddress, text));
                }
                return;
            }
            this.logger.LogEvent(LogEventType.Verbose, string.Format("PublicFolderSplitProcessor::{0}::Invoke - Begin processing {1}", this.GetHashCode(), this.publicFolderSession.DisplayAddress));
            try
            {
                this.ReadSplitState();
                ISplitOperation splitOperation = null;
                bool            flag           = false;
                while (!flag && this.IsAnyProcessingNeeded(out splitOperation))
                {
                    splitOperation.Invoke();
                    flag = this.CheckPoint(splitOperation);
                }
            }
            catch (SplitProcessorException ex)
            {
                this.logger.LogEvent(LogEventType.Error, string.Format("PublicFolderSplitProcessor::{0}::Invoke - Unable to process {1}. Exception {2}", this.GetHashCode(), this.publicFolderSession.DisplayAddress, ex));
                if (!ex.IsTransient)
                {
                    this.MarkOverallSplitJobComplete(ex, null);
                }
                try
                {
                    this.SaveSplitState();
                }
                catch (SplitProcessorException arg)
                {
                    this.logger.LogEvent(LogEventType.Error, string.Format("PublicFolderSplitProcessor::{0}::Invoke - Unable to save the state for {1}. Exception {2}", this.GetHashCode(), this.publicFolderSession.DisplayAddress, arg));
                }
            }
            catch (RuntimeException ex2)
            {
                this.LogCompletion(ex2);
                throw new AIGrayException(ex2);
            }
            catch (Exception unexpectedError)
            {
                this.LogCompletion(unexpectedError);
                throw;
            }
            if (this.splitState.ProgressState == SplitProgressState.SplitCompleted)
            {
                this.LogCompletion(null);
            }
            this.logger.LogEvent(LogEventType.Verbose, string.Format("PublicFolderSplitProcessor::{0}::Invoke - End processing {1}", this.GetHashCode(), this.publicFolderSession.DisplayAddress));
        }
        // Token: 0x06000F3D RID: 3901 RVA: 0x0005B2FC File Offset: 0x000594FC
        private bool IsAnyProcessingNeeded(out ISplitOperation nextOperation)
        {
            nextOperation = null;
            bool result = false;

            switch (this.splitState.ProgressState)
            {
            case SplitProgressState.SplitNotStarted:
                if (this.IsSplitNeeded())
                {
                    result        = true;
                    nextOperation = this.operationFactory.CreateIdentifyTargetMailboxOperation(this.splitState);
                    this.splitState.ProgressState = SplitProgressState.SplitNeeded;
                    this.splitState.OverallSplitState.StartTime = DateTime.UtcNow;
                    this.SaveSplitState();
                }
                break;

            case SplitProgressState.SplitNeeded:
            case SplitProgressState.IdentifyTargetMailboxStarted:
                result        = true;
                nextOperation = this.operationFactory.CreateIdentifyTargetMailboxOperation(this.splitState);
                break;

            case SplitProgressState.IdentifyTargetMailboxCompleted:
            case SplitProgressState.PrepareTargetMailboxStarted:
                result        = true;
                nextOperation = this.operationFactory.CreatePrepareTargetMailboxOperation(this.splitState);
                break;

            case SplitProgressState.PrepareTargetMailboxCompleted:
            case SplitProgressState.PrepareSplitPlanStarted:
                result        = true;
                nextOperation = this.operationFactory.CreatePrepareSplitPlanOperation(this.splitState);
                break;

            case SplitProgressState.PrepareSplitPlanCompleted:
            case SplitProgressState.MoveContentStarted:
                result        = true;
                nextOperation = this.operationFactory.CreateMoveContentOperation(this.splitState);
                break;
            }
            this.logger.LogEvent(LogEventType.Verbose, string.Format("PublicFolderSplitProcessor::{0}::{1}::IsAnyProcessingNeeded - Processing needed {2}, Next operation {3}", new object[]
            {
                this.GetHashCode(),
                this.publicFolderSession.DisplayAddress,
                result.ToString(),
                (nextOperation == null) ? string.Empty : nextOperation.Name
            }));
            return(result);
        }
        // Token: 0x06000F39 RID: 3897 RVA: 0x0005AFC4 File Offset: 0x000591C4
        private bool CheckPoint(ISplitOperation operation)
        {
            bool result = false;

            if (operation.OperationState.CompletedTime != DateTime.MinValue)
            {
                if (operation.OperationState.Error != null || this.splitState.ProgressState == SplitProgressState.MoveContentCompleted)
                {
                    result = true;
                    this.MarkOverallSplitJobComplete(operation.OperationState.Error, operation.OperationState.ErrorDetails, operation.Name);
                }
            }
            else
            {
                result = true;
            }
            this.SaveSplitState();
            return(result);
        }