private int MoveItems(IConversationTree conversationTree, List <GroupOperationResult> results, bool isUndo)
        {
            int            num              = 0;
            List <StoreId> list             = new List <StoreId>();
            StoreId        defaultFolderId  = ((MailboxSession)base.Session).GetDefaultFolderId(DefaultFolderType.Inbox);
            StoreId        defaultFolderId2 = ((MailboxSession)base.Session).GetDefaultFolderId(DefaultFolderType.SentItems);
            StoreId        defaultFolderId3 = ((MailboxSession)base.Session).GetDefaultFolderId(DefaultFolderType.DeletedItems);

            foreach (IConversationTreeNode conversationTreeNode in conversationTree)
            {
                for (int i = 0; i < conversationTreeNode.StorePropertyBags.Count; i++)
                {
                    if (!this.CanSkipProcessing(conversationTreeNode.StorePropertyBags[i]))
                    {
                        StoreId item    = conversationTreeNode.StorePropertyBags[i].TryGetProperty(ItemSchema.Id) as StoreId;
                        StoreId storeId = conversationTreeNode.StorePropertyBags[i].TryGetProperty(StoreObjectSchema.ParentItemId) as StoreId;
                        if (isUndo)
                        {
                            if (!storeId.Equals(defaultFolderId2) && !storeId.Equals(defaultFolderId))
                            {
                                num++;
                                list.Add(item);
                            }
                        }
                        else if (!storeId.Equals(defaultFolderId2) && !storeId.Equals(this.TargetFolderId) && (this.ConversationActionLastMoveFolderId == null || (this.ConversationActionLastMoveFolderId.Length == 0 && !this.TargetFolderId.Equals(defaultFolderId3)) || ArrayComparer <byte> .Comparer.Equals(storeId.GetBytes(), this.ConversationActionLastMoveFolderId)))
                        {
                            num++;
                            list.Add(item);
                        }
                    }
                }
            }
            if (list.Count > 0)
            {
                AggregateOperationResult aggregateOperationResult;
                if (isUndo)
                {
                    aggregateOperationResult = base.Session.Move(defaultFolderId, list.ToArray());
                }
                else
                {
                    aggregateOperationResult = base.Session.Move(this.TargetFolderId, list.ToArray());
                }
                if (aggregateOperationResult != null && aggregateOperationResult.GroupOperationResults != null && aggregateOperationResult.GroupOperationResults.Length > 0)
                {
                    foreach (GroupOperationResult item2 in aggregateOperationResult.GroupOperationResults)
                    {
                        results.Add(item2);
                    }
                }
            }
            if (isUndo)
            {
                base.Delete(ConversationActionItemSchema.ConversationActionLastMoveFolderId);
            }
            else if (this.AlwaysDeleteValue)
            {
                if (this.ConversationActionLastMoveFolderId == null || this.ConversationActionLastMoveFolderId.Length != 0)
                {
                    this.ConversationActionLastMoveFolderId = Array <byte> .Empty;
                }
            }
            else if (!ArrayComparer <byte> .Comparer.Equals(this.ConversationActionLastMoveFolderId, this.TargetFolderId.GetBytes()))
            {
                this.ConversationActionLastMoveFolderId = this.TargetFolderId.GetBytes();
            }
            return(num);
        }