Esempio n. 1
0
 List <WellKnownFolder> IMailbox.DiscoverWellKnownFolders(int flags)
 {
     MrsTracer.ProxyClient.Function("RemoteMailbox.DiscoverWellKnownFolders", new object[0]);
     this.VerifyMailboxConnection();
     if (!base.ServerVersion[35])
     {
         return(FolderHierarchyUtils.DiscoverWellKnownFolders(this, flags));
     }
     return(base.MrsProxy.IMailbox_DiscoverWellKnownFolders(base.Handle, flags));
 }
 private static void FindWellKnownFoldersWithinInbox(IMailbox mailbox, Dictionary <WellKnownFolderType, byte[]> wellKnownFolders)
 {
     byte[] receiveFolderEntryId = mailbox.GetReceiveFolderEntryId("IPM");
     if (receiveFolderEntryId != null)
     {
         using (IFolder inbox = CommonUtils.GetFolder(mailbox, receiveFolderEntryId))
         {
             if (inbox != null)
             {
                 FolderHierarchyUtils.FindWellKnownFolders(mailbox, FolderHierarchyUtils.InboxRefs, (PropTag[] pta) => inbox.GetProps(pta), wellKnownFolders);
             }
         }
     }
 }
        public static List <WellKnownFolder> DiscoverWellKnownFolders(IMailbox mailbox, int flags)
        {
            Dictionary <WellKnownFolderType, byte[]> dictionary = new Dictionary <WellKnownFolderType, byte[]>();
            bool flag = ((FolderHierarchyFlags)flags).HasFlag(FolderHierarchyFlags.PublicFolderMailbox);

            FolderHierarchyUtils.FindWellKnownFolders(mailbox, flag ? FolderHierarchyUtils.PublicFolderMailboxRefs : FolderHierarchyUtils.MailboxRefs, (PropTag[] pta) => mailbox.GetProps(pta), dictionary);
            if (!flag)
            {
                FolderHierarchyUtils.FindWellKnownFoldersWithinInbox(mailbox, dictionary);
            }
            List <WellKnownFolder> list = new List <WellKnownFolder>();

            foreach (KeyValuePair <WellKnownFolderType, byte[]> keyValuePair in dictionary)
            {
                list.Add(new WellKnownFolder((int)keyValuePair.Key, keyValuePair.Value));
            }
            return(list);
        }
Esempio n. 4
0
        private void WriteWellKnownFolderReference(WellKnownFolderType wkfType, byte[] folderId)
        {
            WellKnownFolderMapping wellKnownFolderMapping = FolderHierarchyUtils.FindWKFMapping(wkfType, (int)this.Flags);
            PropTagFolderMapping   propTagFolderMapping   = wellKnownFolderMapping as PropTagFolderMapping;

            if (propTagFolderMapping != null)
            {
                if (propTagFolderMapping is MailboxRootFolderMapping)
                {
                    IDestinationMailbox mbx = this.MbxWrapper.Mailbox as IDestinationMailbox;
                    this.WriteEntryIdReference(propTagFolderMapping, folderId, (PropTag[] pta) => mbx.GetProps(pta), delegate(PropValueData[] pvda)
                    {
                        mbx.SetProps(pvda);
                    });
                    return;
                }
                if (propTagFolderMapping is InboxFolderMapping)
                {
                    this.WriteWellKnownFolderReferenceToFolder(WellKnownFolderType.Inbox, wkfType, propTagFolderMapping, folderId);
                    this.WriteWellKnownFolderReferenceToFolder(WellKnownFolderType.NonIpmSubtree, wkfType, propTagFolderMapping, folderId);
                    return;
                }
            }
            else
            {
                if (wellKnownFolderMapping is NamedFolderMapping)
                {
                    return;
                }
                MrsTracer.Service.Warning("Unable to write WKF reference {0} -> {1}", new object[]
                {
                    wkfType,
                    TraceUtils.DumpEntryId(folderId)
                });
            }
        }
Esempio n. 5
0
 List <WellKnownFolder> IMailbox.DiscoverWellKnownFolders(int flags)
 {
     return(FolderHierarchyUtils.DiscoverWellKnownFolders(this, flags));
 }