public NavigationNodeFolder[] FindFoldersById(StoreObjectId folderId) { List <NavigationNodeFolder> list = new List <NavigationNodeFolder>(); foreach (NavigationNodeFolder navigationNodeFolder in this.children) { if (navigationNodeFolder.FolderId != null && folderId.CompareTo(navigationNodeFolder.FolderId) == 0) { list.Add(navigationNodeFolder); } } return(list.ToArray()); }
// Token: 0x06001767 RID: 5991 RVA: 0x0008B328 File Offset: 0x00089528 public MailboxUtilityDeviceInfo GetDevice(DeviceIdentity deviceIdentity) { using (Folder folder = Folder.Bind(this.MailboxSessionForUtility, this.MailboxSessionForUtility.GetDefaultFolderId(DefaultFolderType.Configuration))) { StoreObjectId folderIdByDisplayName = MailboxUtility.GetFolderIdByDisplayName(folder, "Microsoft-Server-ActiveSync"); if (folderIdByDisplayName == null) { return(null); } using (Folder folder2 = Folder.Bind(this.MailboxSessionForUtility, folderIdByDisplayName)) { StoreObjectId folderIdByDisplayName2 = MailboxUtility.GetFolderIdByDisplayName(folder2, deviceIdentity.DeviceType); if (folderIdByDisplayName2 == null) { return(null); } using (QueryResult queryResult = folder2.FolderQuery(FolderQueryFlags.DeepTraversal, null, null, MailboxUtility.folderProperties)) { QueryFilter seekFilter = new ComparisonFilter(ComparisonOperator.Equal, FolderSchema.DisplayName, deviceIdentity.DeviceId); queryResult.SeekToCondition(SeekReference.OriginBeginning, seekFilter); object[] array = null; object[][] rows; while (array == null && (rows = queryResult.GetRows(10000)) != null && rows.Length > 0) { for (int i = 0; i < rows.Length; i++) { StoreObjectId storeObjectId = rows[i][1] as StoreObjectId; if (storeObjectId.CompareTo(folderIdByDisplayName2) == 0) { array = rows[i]; break; } } } if (array != null) { StoreObjectId storeOrVersionedId = MailboxUtility.GetStoreOrVersionedId(array[0]); if (storeOrVersionedId == null) { return(null); } using (Folder folder3 = Folder.Bind(this.MailboxSessionForUtility, storeOrVersionedId)) { using (QueryResult queryResult2 = folder3.ItemQuery(ItemQueryType.None, null, null, MailboxUtility.itemSubjectProperty)) { object[][] rows2 = queryResult2.GetRows(10000); HashSet <string> hashSet = new HashSet <string>(); while (rows2 != null && rows2.Length > 0) { for (int j = 0; j < rows2.Length; j++) { string text = rows2[j][0] as string; if (text != null) { hashSet.TryAdd(text); } } rows2 = queryResult2.GetRows(10000); } return(new MailboxUtilityDeviceInfo(deviceIdentity.DeviceId, deviceIdentity.DeviceType, storeOrVersionedId, hashSet)); } } } } } } return(null); }
public int RemoveFolderByLegacyDNandId(string mailboxLegacyDN, StoreObjectId folderId) { int num = 0; for (int i = this.children.Count - 1; i >= 0; i--) { if (StringComparer.OrdinalIgnoreCase.Equals(mailboxLegacyDN, this.children[i].MailboxLegacyDN) && folderId.CompareTo(this.children[i].FolderId) == 0) { this.children.RemoveAt(i); num++; } } return(num); }