示例#1
0
        public JsonResult UpdateMailboxes(DateTime catalogDateTime)
        {
            UpdateMailboxesModel result = new UpdateMailboxesModel();
            result.CatalogTime = catalogDateTime;

            var tree = new Tree();
            var allMailboxes = tree.GetAllMailbox();
            List<Item> infos = new List<Item>(allMailboxes.Count);
            foreach (var mailbox in allMailboxes)
            {
                infos.Add(new Item() { Id = mailbox.RootFolderId, DisplayName = mailbox.DisplayName, ChildCount = tree.GetChildCount(mailbox.RootFolderId), ItemType = "Mailbox", OtherInformation = mailbox});
            }

            result.Details = infos;
            return Json(result);
        }
示例#2
0
 private List<Item> GetContainer(string folderId, Tree tree)
 {
     var allRootFolder = tree.GetDirectFolder(folderId);
     List<Item> result = new List<Item>();
     foreach (var folder in allRootFolder)
     {
         var item = new Item() { Id = folder.FolderId, ChildCount = tree.GetChildCount(folder.FolderId), DisplayName = folder.DisplayName, ItemType = "Folder" };
         item.Container = GetContainer(folder.FolderId, tree);
         result.Add(item);
     }
     return result;
 }