Beispiel #1
0
        // Token: 0x06002FB0 RID: 12208 RVA: 0x00115220 File Offset: 0x00113420
        private NavigationTreeDirtyFlag CheckNavigationTreeDirtyFlag(Folder folder, bool includeSelf)
        {
            NavigationTreeDirtyFlag navigationTreeDirtyFlag = includeSelf ? FolderTreeNode.GetAffectedTreeFromContainerClass(folder.ClassName) : NavigationTreeDirtyFlag.None;

            object[][] array;
            using (QueryResult queryResult = folder.FolderQuery(FolderQueryFlags.DeepTraversal, null, null, new PropertyDefinition[]
            {
                FolderSchema.IsHidden,
                StoreObjectSchema.ContainerClass
            }))
            {
                array = Utilities.FetchRowsFromQueryResult(queryResult, 10000);
            }
            for (int i = 0; i < array.Length; i++)
            {
                if (!(array[i][0] is bool) || !(bool)array[i][0])
                {
                    navigationTreeDirtyFlag |= FolderTreeNode.GetAffectedTreeFromContainerClass(array[i][1] as string);
                }
            }
            return(navigationTreeDirtyFlag);
        }
Beispiel #2
0
        public void New()
        {
            ExTraceGlobals.MailCallTracer.TraceDebug((long)this.GetHashCode(), "TreeEventHandler.New");
            OwaStoreObjectId owaStoreObjectId = (OwaStoreObjectId)base.GetParameter("destId");

            if (owaStoreObjectId.IsOtherMailbox)
            {
                throw new OwaInvalidRequestException("Cannot add new folder underneath a shared folder");
            }
            string text       = (string)base.GetParameter("fC");
            string text2      = (string)base.GetParameter("fN");
            bool   isExpanded = (bool)base.GetParameter("exp");

            if (Utilities.IsDefaultFolderId(base.UserContext, owaStoreObjectId, DefaultFolderType.SearchFolders))
            {
                throw new OwaInvalidRequestException("Cannot Create new Search Folder through OWA");
            }
            if (Utilities.IsELCRootFolder(owaStoreObjectId, base.UserContext))
            {
                throw new OwaInvalidRequestException("Cannot create new folders under the root ELC folder.");
            }
            text2 = text2.Trim();
            if (text2.Length == 0)
            {
                throw new OwaEventHandlerException("User did not provide name for new folder", LocalizedStrings.GetNonEncoded(-41080803), true);
            }
            StoreObjectType objectType = owaStoreObjectId.StoreObjectId.ObjectType;

            if (!this.CanFolderHaveSubFolders(owaStoreObjectId))
            {
                throw new OwaInvalidRequestException("Cannot Create new Search Folder through OWA");
            }
            using (Folder folder = Utilities.CreateSubFolder(owaStoreObjectId, objectType, text2, base.UserContext))
            {
                folder.ClassName = text;
                try
                {
                    folder.Save();
                }
                catch (ObjectExistedException)
                {
                    throw;
                }
                catch (StoragePermanentException innerException)
                {
                    throw new OwaAccessDeniedException(LocalizedStrings.GetNonEncoded(995407892), innerException);
                }
                folder.Load();
                OwaStoreObjectId newFolderId = OwaStoreObjectId.CreateFromStoreObject(folder);
                this.RenderFolderTreeChangedNode(owaStoreObjectId, newFolderId, isExpanded, owaStoreObjectId.IsArchive, (FolderTreeRenderType)base.GetParameter("rdt"));
                NavigationTreeDirtyFlag navigationTreeDirtyFlag = FolderTreeNode.GetAffectedTreeFromContainerClass(text);
                if (owaStoreObjectId.IsArchive)
                {
                    navigationTreeDirtyFlag |= NavigationTreeDirtyFlag.Favorites;
                }
                if (navigationTreeDirtyFlag != NavigationTreeDirtyFlag.Favorites || owaStoreObjectId.IsArchive)
                {
                    RenderingUtilities.RenderNavigationTreeDirtyFlag(this.Writer, base.UserContext, navigationTreeDirtyFlag, (NavigationModule[])base.GetParameter("cms"));
                }
            }
        }