예제 #1
0
 private void CleanupSubscriptions()
 {
     if (this.hierSub != null)
     {
         OwaMapiNotificationHandler.DisposeXSOObjects(this.hierSub);
     }
     this.hierSub = null;
     if (this.resultHierarchy != null)
     {
         OwaMapiNotificationHandler.DisposeXSOObjects(this.resultHierarchy);
     }
     this.resultHierarchy = null;
     if (this.newmailSub != null)
     {
         OwaMapiNotificationHandler.DisposeXSOObjects(this.newmailSub);
     }
     this.newmailSub = null;
     if (this.reminderSub != null)
     {
         OwaMapiNotificationHandler.DisposeXSOObjects(this.reminderSub);
         OwaMapiNotificationHandler.DisposeXSOObjects(this.queryResultReminder);
     }
     this.reminderSub         = null;
     this.queryResultReminder = null;
     this.ResetSearchFolderReferences(true);
 }
예제 #2
0
        protected override void InternalDispose(bool isDisposing)
        {
            bool flag = false;

            ExTraceGlobals.NotificationsCallTracer.TraceDebug <bool>((long)this.GetHashCode(), "OwaMapiNotificationHandler.Dispose. IsDisposing: {0}", isDisposing);
            lock (this)
            {
                if (this.isDisposed)
                {
                    return;
                }
                if (isDisposing)
                {
                    this.isDisposed = true;
                    flag            = true;
                }
            }
            if (flag)
            {
                try
                {
                    this.userContext.Lock();
                    OwaMapiNotificationHandler.UpdateMailboxSessionBeforeAccessing(this.mailboxSession, this.userContext);
                    lock (this)
                    {
                        this.flags = ClientSubscriptionFlags.None;
                        if (this.folderChangeList != null)
                        {
                            this.folderChangeList.Clear();
                        }
                        this.folderChangeList = null;
                        if (this.folderCountsList != null)
                        {
                            this.folderCountsList.Clear();
                        }
                        this.folderCountsList = null;
                        this.ClearSearchFolderDeleteList();
                        this.searchFolderDeleteList = null;
                        this.CleanupSubscriptions();
                        if (this.delegateSessionHandle != null)
                        {
                            OwaMapiNotificationHandler.DisposeXSOObjects(this.delegateSessionHandle);
                        }
                        this.delegateSessionHandle = null;
                    }
                }
                finally
                {
                    if (this.userContext.LockedByCurrentThread())
                    {
                        this.userContext.Unlock();
                    }
                }
            }
        }
 // Token: 0x06000837 RID: 2103 RVA: 0x0003CFE0 File Offset: 0x0003B1E0
 private void DisposeInternal()
 {
     if (!this.userContext.LockedByCurrentThread())
     {
         throw new InvalidOperationException("User context needs to be locked while this operation is called");
     }
     if (this.mapiSubscription != null)
     {
         OwaMapiNotificationHandler.DisposeXSOObjects(this.mapiSubscription);
         this.mapiSubscription = null;
     }
 }
예제 #4
0
 private void ResetSearchFolderReferences(bool cleanupOldSubscription)
 {
     if (cleanupOldSubscription && this.searchSub != null)
     {
         if (!this.userContext.LockedByCurrentThread())
         {
             throw new InvalidOperationException("UserContext lock should be acquired before calling this method");
         }
         OwaMapiNotificationHandler.DisposeXSOObjects(this.searchSub);
         this.searchSub = null;
     }
     this.searchFolderIdCurrent   = null;
     this.isTopPageSearchComplete = false;
 }
예제 #5
0
 public void UnsubscribeNewMail()
 {
     if (!this.userContext.LockedByCurrentThread())
     {
         throw new InvalidOperationException("UserContext lock should be acquired before calling this method");
     }
     lock (this)
     {
         this.flags &= ~ClientSubscriptionFlags.NewMail;
         if (this.newmailSub != null)
         {
             OwaMapiNotificationHandler.DisposeXSOObjects(this.newmailSub);
         }
         this.newmailSub = null;
     }
 }
 // Token: 0x06001444 RID: 5188 RVA: 0x0007BAF0 File Offset: 0x00079CF0
 internal virtual void DisposeInternal(bool doNotDisposeQueryResult)
 {
     if (!this.userContext.LockedByCurrentThread())
     {
         throw new InvalidOperationException("User context needs to be locked while this operation is called");
     }
     if (!doNotDisposeQueryResult && this.result != null)
     {
         OwaMapiNotificationHandler.DisposeXSOObjects(this.result);
         this.result = null;
     }
     if (this.mapiSubscription != null)
     {
         OwaMapiNotificationHandler.DisposeXSOObjects(this.mapiSubscription);
         this.mapiSubscription = null;
     }
 }
예제 #7
0
 private void InitHierarchyTableSubscription()
 {
     if (this.hierSub == null)
     {
         if (this.resultHierarchy != null)
         {
             OwaMapiNotificationHandler.DisposeXSOObjects(this.resultHierarchy);
         }
         this.resultHierarchy = null;
         using (Folder folder = Folder.Bind(this.mailboxSession, DefaultFolderType.Configuration))
         {
             this.resultHierarchy = folder.FolderQuery(FolderQueryFlags.DeepTraversal, null, null, this.querySubscriptionProperties);
             this.resultHierarchy.GetRows(this.resultHierarchy.EstimatedRowCount);
             this.hierSub = Subscription.Create(this.resultHierarchy, new NotificationHandler(this.HandleHierarchyNotification));
         }
     }
 }
        // Token: 0x0600145F RID: 5215 RVA: 0x0007C450 File Offset: 0x0007A650
        internal bool TrySubscribe(ConnectionDroppedNotificationHandler connectionDroppedNotificationHandler)
        {
            bool result;

            lock (this.syncRoot)
            {
                if (this.isDisposed)
                {
                    throw new InvalidOperationException("Cannot call Subscribe on a Disposed object");
                }
                if (!this.userContext.LockedByCurrentThread())
                {
                    throw new InvalidOperationException("UserContext lock should be acquired before calling this method");
                }
                ExTraceGlobals.NotificationsCallTracer.TraceDebug <string>((long)this.GetHashCode(), "Subscribing for folder content change notifications for user {0}", this.MailboxSessionDisplayName);
                try
                {
                    this.InitSubscription();
                }
                catch (MapiExceptionObjectDisposed)
                {
                    OwaMapiNotificationHandler.DisposeXSOObjects(this.result);
                    return(false);
                }
                catch (ObjectDisposedException)
                {
                    return(false);
                }
                catch (StoragePermanentException)
                {
                    return(false);
                }
                catch (StorageTransientException)
                {
                    return(false);
                }
                this.payload.AttachFolderContentChangeNotificationHandler(this.contextFolderId, this);
                connectionDroppedNotificationHandler.OnConnectionDropped += this.HandleConnectionDroppedNotification;
                result = true;
            }
            return(result);
        }