// Token: 0x060004A2 RID: 1186 RVA: 0x00021FA8 File Offset: 0x000201A8
        public bool IsEventInteresting(MapiEvent mapiEvent)
        {
            ElcEventBasedAssistant.Tracer.TraceDebug <MapiEvent>((long)this.GetHashCode(), "MapiEvent is dispatched: {0}", mapiEvent);
            if (!this.IsEventRelevant(mapiEvent))
            {
                return(false);
            }
            CachedState cachedState = AssistantsService.CachedObjectsList.GetCachedState(mapiEvent.MailboxGuid);
            UserRetentionPolicyCache userRetentionPolicyCache = RetentionPolicyCheck.QuickCheckForRetentionPolicy(mapiEvent, cachedState);

            if (userRetentionPolicyCache == null || userRetentionPolicyCache.UnderRetentionPolicy)
            {
                bool flag = RetentionPolicyCheck.IsEventConfigChange(mapiEvent);
                if (flag)
                {
                    RetentionPolicyCheck.UpdateStateForPendingFaiEvent(mapiEvent.EventCounter, cachedState);
                    ElcEventBasedAssistant.Tracer.TraceDebug <object, MapiEvent>((long)this.GetHashCode(), "{0}: this event is interesting because it is a change to our FAI: {1}", TraceContext.Get(), mapiEvent);
                    return(true);
                }
                if (RetentionPolicyCheck.IsAutoTagFai(mapiEvent))
                {
                    ElcEventBasedAssistant.Tracer.TraceDebug <object, MapiEvent>((long)this.GetHashCode(), "{0}: this event is interesting because it is a change to an Autotag FAI: {1}", TraceContext.Get(), mapiEvent);
                    return(true);
                }
                MapiEventTypeFlags mapiEventTypeFlags = MapiEventTypeFlags.ObjectCreated | MapiEventTypeFlags.ObjectModified | MapiEventTypeFlags.ObjectMoved | MapiEventTypeFlags.ObjectCopied;
                if ((mapiEvent.EventMask & mapiEventTypeFlags) != (MapiEventTypeFlags)0)
                {
                    if (mapiEvent.ClientType == MapiEventClientTypes.Transport && userRetentionPolicyCache != null && !this.InSentItems(userRetentionPolicyCache, mapiEvent))
                    {
                        ElcEventBasedAssistant.Tracer.TraceDebug <MapiEvent>((long)this.GetHashCode(), "Event is from transport and item not in SentItems. Ignoring from IsEventInteresting. Mapievent: {0}", mapiEvent);
                        return(false);
                    }
                    if (userRetentionPolicyCache != null && !this.IsEventOnRelevantFolder(userRetentionPolicyCache, mapiEvent))
                    {
                        return(false);
                    }
                    if (userRetentionPolicyCache != null && TagAssistantHelper.IsConflictableItem(mapiEvent.ObjectClass, mapiEvent.ParentEntryId, userRetentionPolicyCache.DeletedItemsId))
                    {
                        return(false);
                    }
                    MapiEventTypeFlags mapiEventTypeFlags2 = MapiEventTypeFlags.ObjectMoved | MapiEventTypeFlags.ObjectCopied;
                    if (mapiEvent.ItemType == ObjectType.MAPI_FOLDER && (mapiEvent.EventMask & mapiEventTypeFlags2) != (MapiEventTypeFlags)0)
                    {
                        ElcEventBasedAssistant.Tracer.TraceDebug <object, MapiEvent>((long)this.GetHashCode(), "{0}: this event is interesting because is a moved folder: {1}", TraceContext.Get(), mapiEvent);
                        return(true);
                    }
                    if (mapiEvent.ItemType == ObjectType.MAPI_MESSAGE)
                    {
                        ElcEventBasedAssistant.Tracer.TraceDebug <object, MapiEvent>((long)this.GetHashCode(), "{0}: this event is interesting because is a message: {1}", TraceContext.Get(), mapiEvent);
                        return(true);
                    }
                }
            }
            return(false);
        }
        // Token: 0x060004A4 RID: 1188 RVA: 0x00022330 File Offset: 0x00020530
        private bool IsEventRelevant(MapiEvent mapiEvent)
        {
            if ((mapiEvent.ExtendedEventFlags & MapiExtendedEventFlags.NonIPMFolder) == MapiExtendedEventFlags.NonIPMFolder)
            {
                ElcEventBasedAssistant.Tracer.TraceDebug <MapiEvent>((long)this.GetHashCode(), "Non IPM Folder events are not relevant. MapiEvent: {0}", mapiEvent);
                return(false);
            }
            if ((mapiEvent.EventFlags & MapiEventFlags.SearchFolder) == MapiEventFlags.SearchFolder)
            {
                ElcEventBasedAssistant.Tracer.TraceDebug <MapiEvent>((long)this.GetHashCode(), "SearchFolder events are not relevant. MapiEvent: {0}", mapiEvent);
                return(false);
            }
            if ((mapiEvent.EventFlags & MapiEventFlags.ContentOnly) == MapiEventFlags.ContentOnly)
            {
                ElcEventBasedAssistant.Tracer.TraceDebug <MapiEvent>((long)this.GetHashCode(), "ContentOnly events are not relevant. MapiEvent: {0}", mapiEvent);
                return(false);
            }
            if (ObjectClass.IsCalendarItem(mapiEvent.ObjectClass) || ObjectClass.IsTask(mapiEvent.ObjectClass))
            {
                ElcEventBasedAssistant.Tracer.TraceDebug <MapiEvent>((long)this.GetHashCode(), "Calendar and task items are not relevent. Mapievent: {0}", mapiEvent);
                return(false);
            }
            if (mapiEvent.ClientType == MapiEventClientTypes.Transport)
            {
                ElcEventBasedAssistant.Tracer.TraceDebug <MapiEvent>((long)this.GetHashCode(), "Skip events from Transport. Mapievent: {0}", mapiEvent);
                return(false);
            }
            MapiEventTypeFlags mapiEventTypeFlags = MapiEventTypeFlags.ObjectCreated | MapiEventTypeFlags.ObjectModified | MapiEventTypeFlags.ObjectMoved | MapiEventTypeFlags.ObjectCopied;

            if ((mapiEvent.EventMask & mapiEventTypeFlags) == (MapiEventTypeFlags)0)
            {
                ElcEventBasedAssistant.Tracer.TraceDebug <MapiEvent>((long)this.GetHashCode(), "No interesting MapiEventTypeFlags. Skip. Mapievent: {0}", mapiEvent);
                return(false);
            }
            if ((mapiEvent.EventMask & MapiEventTypeFlags.ObjectModified) != (MapiEventTypeFlags)0 && (mapiEvent.EventFlags & MapiEventFlags.FolderAssociated) == MapiEventFlags.None && mapiEvent.ItemType == ObjectType.MAPI_MESSAGE && (mapiEvent.ExtendedEventFlags & MapiExtendedEventFlags.RetentionTagModified) == MapiExtendedEventFlags.None && (mapiEvent.ExtendedEventFlags & MapiExtendedEventFlags.RetentionPropertiesModified) == MapiExtendedEventFlags.None)
            {
                ElcEventBasedAssistant.Tracer.TraceDebug <MapiEvent>((long)this.GetHashCode(), "Item was modified. Either the property modified is not relevent to us . Mapievent: {0}", mapiEvent);
                return(false);
            }
            if (mapiEvent.ClientType == MapiEventClientTypes.TimeBasedAssistants && !RetentionPolicyCheck.IsEventConfigChange(mapiEvent) && !RetentionPolicyCheck.IsAutoTagFai(mapiEvent))
            {
                ElcEventBasedAssistant.Tracer.TraceDebug <MapiEvent>((long)this.GetHashCode(), "Event is from Time Based Assistant and not FAI related. Ignoring. Mapievent: {0}", mapiEvent);
                return(false);
            }
            if (mapiEvent.ClientType == MapiEventClientTypes.EventBasedAssistants)
            {
                ElcEventBasedAssistant.Tracer.TraceDebug <MapiEvent>((long)this.GetHashCode(), "Event is from this assistant. Ignoring. Mapievent: {0}", mapiEvent);
                return(false);
            }
            if ((mapiEvent.EventFlags & MapiEventFlags.FolderAssociated) != MapiEventFlags.None && !RetentionPolicyCheck.IsEventConfigChange(mapiEvent) && !RetentionPolicyCheck.IsAutoTagFai(mapiEvent))
            {
                ElcEventBasedAssistant.Tracer.TraceDebug <MapiEvent>((long)this.GetHashCode(), "FAI we don't care about. Ignoring. Mapievent: {0}", mapiEvent);
                return(false);
            }
            if (mapiEvent.ItemType != ObjectType.MAPI_MESSAGE && mapiEvent.ItemType != ObjectType.MAPI_FOLDER)
            {
                ElcEventBasedAssistant.Tracer.TraceDebug <MapiEvent>((long)this.GetHashCode(), "Not a message or a folder. Ignoring. Mapievent: {0}", mapiEvent);
                return(false);
            }
            if ((mapiEvent.EventMask & MapiEventTypeFlags.ObjectDeleted) != (MapiEventTypeFlags)0)
            {
                ElcEventBasedAssistant.Tracer.TraceDebug <MapiEvent>((long)this.GetHashCode(), "Item Deleted. Ignoring. Mapievent: {0}", mapiEvent);
                return(false);
            }
            ElcEventBasedAssistant.Tracer.TraceDebug <MapiEvent>((long)this.GetHashCode(), "IsEventRelevant is true. Mapievent: {0}", mapiEvent);
            return(true);
        }