// Token: 0x060023D5 RID: 9173 RVA: 0x000CE96C File Offset: 0x000CCB6C
        private QueryResult GetQueryResult()
        {
            if (!this.ShouldSubscribeForFolderContentChanges)
            {
                return(null);
            }
            OwaStoreObjectId owaStoreObjectId = OwaStoreObjectId.CreateFromSessionFolderId(base.UserContext, this.dataFolder.Session, this.dataFolder.Id.ObjectId);

            if (this.IsQueryResultObsolete(owaStoreObjectId))
            {
                base.UserContext.MapiNotificationManager.UnsubscribeFolderContentChanges(owaStoreObjectId);
                return(null);
            }
            QueryResult folderQueryResult = base.UserContext.MapiNotificationManager.GetFolderQueryResult(owaStoreObjectId);

            if (folderQueryResult != null)
            {
                try
                {
                    folderQueryResult.SeekToOffset(SeekReference.OriginBeginning, 0);
                }
                catch (MapiExceptionObjectDisposed)
                {
                    base.UserContext.MapiNotificationManager.UnsubscribeFolderContentChanges(owaStoreObjectId);
                    return(null);
                }
                catch (ObjectDisposedException)
                {
                    base.UserContext.MapiNotificationManager.UnsubscribeFolderContentChanges(owaStoreObjectId);
                    return(null);
                }
                return(folderQueryResult);
            }
            return(folderQueryResult);
        }
        // Token: 0x060023D3 RID: 9171 RVA: 0x000CE798 File Offset: 0x000CC998
        protected override void SubscribeForFolderContentChanges()
        {
            OwaStoreObjectId owaStoreObjectId = OwaStoreObjectId.CreateFromSessionFolderId(base.UserContext, this.contextFolder.Session, this.contextFolder.Id.ObjectId);

            if (OwaMapiNotificationManager.IsNotificationEnabled(base.UserContext) && !Utilities.IsPublic(this.contextFolder))
            {
                OwaStoreObjectId dataFolderId = OwaStoreObjectId.CreateFromSessionFolderId(base.UserContext, this.dataFolder.Session, this.dataFolder.Id.ObjectId);
                if (base.UserContext.IsPushNotificationsEnabled)
                {
                    MailboxSession mailboxSession = this.contextFolder.Session as MailboxSession;
                    if (mailboxSession != null)
                    {
                        Dictionary <PropertyDefinition, int> propertyMap = null;
                        ExchangeListViewDataSource           exchangeListViewDataSource = (ExchangeListViewDataSource)base.Contents.DataSource;
                        PropertyDefinition[] requestedProperties = exchangeListViewDataSource.GetRequestedProperties(true, ref propertyMap);
                        if (this.ShouldSubscribeForFolderContentChanges)
                        {
                            base.UserContext.MapiNotificationManager.SubscribeForFolderContentChanges(mailboxSession, owaStoreObjectId, dataFolderId, exchangeListViewDataSource.QueryResult, this.CreateListViewContents(), requestedProperties, propertyMap, this.GetSortByProperties(), this.folderFilter, this.IsConversationView);
                        }
                        else
                        {
                            base.UserContext.MapiNotificationManager.SubscribeForFolderChanges(owaStoreObjectId, mailboxSession);
                        }
                    }
                }
            }
            if (base.UserContext.IsPullNotificationsEnabled)
            {
                Dictionary <OwaStoreObjectId, OwaConditionAdvisor> conditionAdvisorTable = base.UserContext.NotificationManager.ConditionAdvisorTable;
                if (conditionAdvisorTable == null || !conditionAdvisorTable.ContainsKey(owaStoreObjectId))
                {
                    base.UserContext.NotificationManager.CreateOwaConditionAdvisor(base.UserContext, this.contextFolder.Session as MailboxSession, owaStoreObjectId, EventObjectType.None, EventType.None);
                }
            }
        }
Beispiel #3
0
        public void RemoveOtherInbox()
        {
            base.ThrowIfCannotActAsOwner();
            OwaStoreObjectId owaStoreObjectId = (OwaStoreObjectId)base.GetParameter("Id");

            if (owaStoreObjectId.MailboxOwnerLegacyDN == null)
            {
                throw new OwaInvalidRequestException("Can't find legacyDN information.");
            }
            OtherMailboxConfiguration.RemoveOtherMailbox(base.UserContext, owaStoreObjectId.MailboxOwnerLegacyDN);
            try
            {
                MailboxSession mailboxSession  = owaStoreObjectId.GetSession(base.UserContext) as MailboxSession;
                StoreObjectId  defaultFolderId = mailboxSession.GetDefaultFolderId(DefaultFolderType.Inbox);
                if (defaultFolderId != null)
                {
                    OwaStoreObjectId owaStoreObjectId2 = OwaStoreObjectId.CreateFromSessionFolderId(base.UserContext, mailboxSession, defaultFolderId);
                    if (base.UserContext.IsPushNotificationsEnabled)
                    {
                        base.UserContext.MapiNotificationManager.UnsubscribeFolderCounts(owaStoreObjectId2, mailboxSession);
                        base.UserContext.MapiNotificationManager.UnsubscribeFolderChanges(owaStoreObjectId2, mailboxSession);
                    }
                    if (base.UserContext.IsPullNotificationsEnabled)
                    {
                        base.UserContext.NotificationManager.DeleteDelegateFolderCountAdvisor(owaStoreObjectId2);
                        base.UserContext.NotificationManager.DeleteOwaConditionAdvisor(owaStoreObjectId2);
                    }
                }
            }
            catch (ObjectNotFoundException arg)
            {
                ExTraceGlobals.CoreCallTracer.TraceDebug <ObjectNotFoundException>(0L, "NavigationNodeEventHandler.RemoveOtherInbox() exception {0}", arg);
            }
        }
Beispiel #4
0
        private void ProcessFolderCountAdvisor(OwaFolderCountAdvisor folderCountAdvisor)
        {
            if (folderCountAdvisor == null)
            {
                throw new ArgumentNullException("folderCountAdvisor");
            }
            MailboxSession mailboxSession = null;

            if (folderCountAdvisor.FolderId == null)
            {
                if (!folderCountAdvisor.MailboxOwner.MailboxInfo.IsAggregated)
                {
                    mailboxSession = base.UserContext.MailboxSession;
                }
                else
                {
                    mailboxSession = base.UserContext.GetArchiveMailboxSession(folderCountAdvisor.MailboxOwner);
                }
            }
            else
            {
                try
                {
                    mailboxSession = (folderCountAdvisor.FolderId.GetSession(base.UserContext) as MailboxSession);
                }
                catch (ObjectNotFoundException)
                {
                    return;
                }
            }
            if (mailboxSession != null)
            {
                Dictionary <StoreObjectId, ItemCountPair> itemCounts = folderCountAdvisor.GetItemCounts(mailboxSession);
                if (itemCounts == null)
                {
                    return;
                }
                IDictionaryEnumerator dictionaryEnumerator = itemCounts.GetEnumerator();
                while (dictionaryEnumerator.MoveNext())
                {
                    ItemCountPair countPair = (ItemCountPair)dictionaryEnumerator.Value;
                    if (countPair.ItemCount != -1L || countPair.UnreadItemCount != -1L)
                    {
                        OwaStoreObjectId owaStoreObjectId = OwaStoreObjectId.CreateFromSessionFolderId(base.UserContext, mailboxSession, (StoreObjectId)dictionaryEnumerator.Key);
                        this.RenderUpdateCountJavascript(owaStoreObjectId, countPair);
                        if (owaStoreObjectId.StoreObjectType == StoreObjectType.Folder)
                        {
                            StoreObjectId folderId = StoreObjectId.FromProviderSpecificId(owaStoreObjectId.StoreObjectId.ProviderLevelItemId, StoreObjectType.OutlookSearchFolder);
                            this.RenderUpdateCountJavascript(OwaStoreObjectId.CreateFromSessionFolderId(base.UserContext, mailboxSession, folderId), countPair);
                            StoreObjectId folderId2 = StoreObjectId.FromProviderSpecificId(owaStoreObjectId.StoreObjectId.ProviderLevelItemId, StoreObjectType.SearchFolder);
                            this.RenderUpdateCountJavascript(OwaStoreObjectId.CreateFromSessionFolderId(base.UserContext, mailboxSession, folderId2), countPair);
                        }
                    }
                }
                return;
            }
        }
Beispiel #5
0
        private void GetFreeBusy()
        {
            DateTime dateTime   = this.dates[0];
            DateTime arg        = this.dates[41];
            Duration timeWindow = new Duration(dateTime, arg.AddDays(1.0));

            ExTraceGlobals.CalendarTracer.TraceDebug <DateTime, DateTime>((long)this.GetHashCode(), "Getting free/busy data from {0} to {1}", dateTime, arg);
            OwaStoreObjectId calendarFolderId = OwaStoreObjectId.CreateFromSessionFolderId(this.owaContext.UserContext, this.owaContext.UserContext.MailboxSession, this.folderId);

            this.freeBusyData = Utilities.GetFreeBusyDataForDatePicker(timeWindow, calendarFolderId, this.owaContext.UserContext);
        }
 // Token: 0x060023D4 RID: 9172 RVA: 0x000CE900 File Offset: 0x000CCB00
 internal override void UnSubscribeForFolderContentChanges()
 {
     if (OwaMapiNotificationManager.IsNotificationEnabled(base.UserContext) && !Utilities.IsPublic(this.contextFolder))
     {
         OwaStoreObjectId folderId = OwaStoreObjectId.CreateFromSessionFolderId(base.UserContext, this.contextFolder.Session, this.contextFolder.Id.ObjectId);
         if (base.UserContext.IsPushNotificationsEnabled)
         {
             base.UserContext.MapiNotificationManager.UnsubscribeFolderContentChanges(folderId);
         }
     }
 }
Beispiel #7
0
        private CalendarFolder OpenFolder(bool throwIfFolderNotFound)
        {
            CalendarFolder calendarFolder = null;

            this.isFromOlderVersion = false;
            if (this.exchangePrincipal == null && (this.FolderId.IsOtherMailbox || this.FolderId.IsGSCalendar) && !this.UserContext.DelegateSessionManager.TryGetExchangePrincipal(this.FolderId.MailboxOwnerLegacyDN, out this.exchangePrincipal))
            {
                throw new OwaLoadSharedCalendarFailedException("cannot get exchange principal");
            }
            try
            {
                if (this.IsGSCalendar)
                {
                    StoreObjectId storeObjectId = Utilities.TryGetDefaultFolderId(this.UserContext, this.exchangePrincipal, DefaultFolderType.Calendar);
                    if (storeObjectId != null)
                    {
                        this.PromotedFolderId = OwaStoreObjectId.CreateFromOtherUserMailboxFolderId(storeObjectId, this.LegacyDN);
                    }
                }
                else
                {
                    this.PromotedFolderId = this.FolderId;
                }
                if (this.PromotedFolderId != null)
                {
                    try
                    {
                        calendarFolder = Utilities.GetFolderForContent <CalendarFolder>(this.UserContext, this.PromotedFolderId, CalendarUtilities.FolderViewProperties);
                        if (!this.IsGSCalendar)
                        {
                            this.FolderId = OwaStoreObjectId.CreateFromSessionFolderId(this.FolderId.OwaStoreObjectIdType, this.FolderId.MailboxOwnerLegacyDN, calendarFolder.StoreObjectId);
                        }
                    }
                    catch (ObjectNotFoundException)
                    {
                        if (throwIfFolderNotFound)
                        {
                            throw;
                        }
                    }
                    catch (WrongObjectTypeException innerException)
                    {
                        throw new OwaInvalidRequestException("The folder is not a calendar folder", innerException, this);
                    }
                }
            }
            catch (OwaSharedFromOlderVersionException)
            {
                this.isFromOlderVersion = true;
                throw;
            }
            return(calendarFolder);
        }
 // Token: 0x06002E90 RID: 11920 RVA: 0x00109EE0 File Offset: 0x001080E0
 protected override VirtualListView2 GetListView()
 {
     base.BindToFolder();
     if (!base.IsFiltered)
     {
         OwaStoreObjectId owaStoreObjectId = OwaStoreObjectId.CreateFromSessionFolderId(base.UserContext, base.ContextFolder.Session, base.ContextFolder.Id.ObjectId);
         OwaStoreObjectId dataFolderId     = OwaStoreObjectId.CreateFromSessionFolderId(base.UserContext, base.DataFolder.Session, base.DataFolder.Id.ObjectId);
         MailboxSession   sessionIn        = base.ContextFolder.Session as MailboxSession;
         if (base.UserContext.MapiNotificationManager.HasDataFolderChanged(sessionIn, owaStoreObjectId, dataFolderId))
         {
             base.UserContext.MapiNotificationManager.UnsubscribeFolderContentChanges(owaStoreObjectId);
         }
     }
     return(new MessageVirtualListView2(base.UserContext, "divVLV", this.ListViewState.IsMultiLine, this.ListViewState.SortedColumn, this.ListViewState.SortOrder, base.ContextFolder, base.DataFolder, this.GetViewFilter(), base.SearchScope, base.IsFiltered, base.FilterCondition));
 }
Beispiel #9
0
        public void AddSharedCalendar()
        {
            using (SharingMessageItem requestItem = base.GetRequestItem <SharingMessageItem>(new PropertyDefinition[0]))
            {
                if (requestItem == null || !requestItem.SharingMessageType.IsInvitationOrAcceptOfRequest || requestItem.SharedFolderType != DefaultFolderType.Calendar)
                {
                    throw new OwaInvalidRequestException("Not a calendar sharing message");
                }
                this.ValidateSharingAction(SharingAction.AddCalendar, requestItem);
                SubscribeResults subscribeResults = null;
                try
                {
                    subscribeResults = requestItem.SubscribeAndOpen();
                }
                catch (NotSupportedWithMailboxVersionException)
                {
                    throw new OwaInvalidRequestException("Your account isn't set up to allow calendars to be added from the Internet.");
                }
                catch (StoragePermanentException ex)
                {
                    string message = string.Format("Unable to subscribe shared calendar folder. Exception {0}", ex.Message);
                    ExTraceGlobals.CalendarCallTracer.TraceDebug(0L, message);
                    this.RenderSubscriptionError(ex);
                    return;
                }
                if (subscribeResults is SubscribeResultsInternal)
                {
                    SubscribeResultsInternal subscribeResultsInternal = (SubscribeResultsInternal)subscribeResults;
                    string            text = StoreEntryId.TryParseMailboxLegacyDN(subscribeResultsInternal.RemoteMailboxId);
                    ExchangePrincipal exchangePrincipal;
                    if (base.UserContext.DelegateSessionManager.TryGetExchangePrincipal(text, out exchangePrincipal))
                    {
                        try
                        {
                            if (requestItem.IsSharedFolderPrimary)
                            {
                                if (!string.Equals(text, base.UserContext.MailboxOwnerLegacyDN, StringComparison.OrdinalIgnoreCase))
                                {
                                    NavigationNodeCollection.AddGSCalendarToSharedFoldersGroup(base.UserContext, exchangePrincipal);
                                }
                            }
                            else
                            {
                                using (OwaStoreObjectIdSessionHandle owaStoreObjectIdSessionHandle = new OwaStoreObjectIdSessionHandle(exchangePrincipal, base.UserContext))
                                {
                                    OwaStoreObjectId folderId = OwaStoreObjectId.CreateFromSessionFolderId(base.UserContext, owaStoreObjectIdSessionHandle.Session, subscribeResultsInternal.RemoteFolderId);
                                    using (Folder folder = Utilities.GetFolder <Folder>(base.UserContext, folderId, FolderList.FolderTreeQueryProperties))
                                    {
                                        if (!Utilities.CanReadItemInFolder(folder))
                                        {
                                            this.RenderNotFoundResponse();
                                            return;
                                        }
                                        NavigationNodeCollection.AddNonMailFolderToSharedFoldersGroup(base.UserContext, folder, NavigationNodeGroupSection.Calendar);
                                    }
                                }
                            }
                            goto IL_1A2;
                        }
                        catch (OwaSharedFromOlderVersionException)
                        {
                            this.RenderSharedFromE12Response();
                            return;
                        }
                        catch (ObjectNotFoundException)
                        {
                            this.RenderNotFoundResponse();
                            return;
                        }
                    }
                    this.RenderNotFoundResponse();
                    return;
                }
                if (subscribeResults is SubscribeResultsExternal)
                {
                    OwaStoreObjectId folderId = OwaStoreObjectId.CreateFromMailboxFolderId(((SubscribeResultsExternal)subscribeResults).LocalFolderId);
                }
IL_1A2:
                this.RenderChangeKey(requestItem);
                ExDateTime now = ExDateTime.GetNow(base.UserContext.TimeZone);
                this.Writer.Write("<div id=\"subInfo\">");
                this.Writer.Write(SanitizedHtmlString.Format(LocalizedStrings.GetHtmlEncoded(388258761), new object[]
                {
                    now.ToString(base.UserContext.UserOptions.DateFormat),
                    now.ToString(base.UserContext.UserOptions.TimeFormat)
                }));
                this.Writer.Write("</div>");
                RenderingUtilities.RenderNavigationTreeDirtyFlag(this.Writer, base.UserContext, NavigationTreeDirtyFlag.Calendar, new NavigationModule[]
                {
                    NavigationModule.Calendar
                });
            }
        }
Beispiel #10
0
 public CalendarAdapter(UserContext userContext, StoreObjectId storeObjectId) : this(userContext, OwaStoreObjectId.CreateFromSessionFolderId(userContext, userContext.MailboxSession, storeObjectId))
 {
 }