Ejemplo n.º 1
0
 // Token: 0x06000B35 RID: 2869 RVA: 0x00048468 File Offset: 0x00046668
 private void HandleJunkEmailOptionsEvent(MapiEvent mapiEvent, MailboxSession mailboxSession)
 {
     if (mapiEvent == null)
     {
         throw new ArgumentNullException("mapiEvent");
     }
     if (mailboxSession == null)
     {
         throw new ArgumentNullException("mailboxSession");
     }
     if (!JunkEmailOptionsAssistant.IsJunkEmailOptionsEvent(mapiEvent))
     {
         JunkEmailOptionsAssistant.Tracer.TraceDebug((long)this.GetHashCode(), "Skipping uninteresting event.");
         return;
     }
     if (!JunkEmailOptionsAssistant.IsUserMailbox(mailboxSession))
     {
         JunkEmailOptionsAssistant.Tracer.TraceDebug((long)this.GetHashCode(), "Skipping event: non-user mailbox.");
         return;
     }
     if (mailboxSession.MailboxOwner.MailboxInfo.IsArchive)
     {
         JunkEmailOptionsAssistant.Tracer.TraceDebug((long)this.GetHashCode(), "Skipping event: archive mailbox.");
         return;
     }
     if (mailboxSession.MailboxOwner.MailboxInfo.IsAggregated)
     {
         JunkEmailOptionsAssistant.Tracer.TraceDebug((long)this.GetHashCode(), "Skipping event: aggregated mailbox.");
         return;
     }
     if (JunkEmailOptionsAssistant.IsJunkRuleEvent(mapiEvent))
     {
         try
         {
             MailboxTagging.TagForProcessing(mailboxSession);
         }
         catch (StoragePermanentException arg)
         {
             JunkEmailOptionsAssistant.Tracer.TraceError <string, Guid, StoragePermanentException>((long)this.GetHashCode(), "Failed at tagging mailbox {0} (GUID: {1}).  Exception: {2}", mailboxSession.MailboxOwner.MailboxInfo.DisplayName, mailboxSession.MailboxGuid, arg);
         }
         return;
     }
     if (JunkEmailOptionsAssistant.IsMailboxMoveToThisDatabase(mapiEvent))
     {
         MapiExceptionFilter.TryOperation(delegate()
         {
             JunkEmailOptionsAssistant.EnsureJunkEmailRule(mailboxSession, mapiEvent);
         }, (Exception exception, bool transient) => JunkEmailOptionsAssistant.LogFailedToEnsureJunkEmailRule(exception, transient, mailboxSession));
         return;
     }
     if (JunkEmailOptionsAssistant.IsFolderCreationEvent(mapiEvent))
     {
         MapiExceptionFilter.TryOperation(delegate()
         {
             JunkEmailOptionsAssistant.EnsureJunkEmailRule(mailboxSession, mapiEvent);
         }, (Exception exception, bool transient) => JunkEmailOptionsAssistant.LogFailedToEnsureJunkEmailRule(exception, transient, mailboxSession));
         return;
     }
     JunkEmailOptionsAssistant.Tracer.TraceError((long)this.GetHashCode(), "HandleJunkEmailOptionsEvent was called under unexpected conditions");
 }
 // Token: 0x06000B69 RID: 2921 RVA: 0x00049798 File Offset: 0x00047998
 public static void TryOperation(Action operation, Func <Exception, bool, bool> exceptionHandler)
 {
     if (operation == null)
     {
         throw new ArgumentNullException("operation");
     }
     if (exceptionHandler == null)
     {
         throw new ArgumentNullException("exceptionHandler");
     }
     MapiExceptionFilter.TryOperation <object>(MapiExceptionFilter.ConvertActionToFunc(operation), null, exceptionHandler);
 }