internal ContactFolders(MyContactFolders myContactFolders, StoreObjectId myContactsSearchFolderId, StoreObjectId quickContactsFolderId, StoreObjectId favoritesFolderId) { this.myContactFolders = myContactFolders; this.myContactsSearchFolderId = myContactsSearchFolderId; this.quickContactsFolderId = quickContactsFolderId; this.favoritesFolderId = favoritesFolderId; }
internal static ContactFolders Load(IXSOFactory xsoFactory, IMailboxSession mailboxSession) { MyContactFolders myContactFolders = new MyContactFolders(xsoFactory, mailboxSession); StoreObjectId defaultFolderId = mailboxSession.GetDefaultFolderId(DefaultFolderType.MyContacts); StoreObjectId defaultFolderId2 = mailboxSession.GetDefaultFolderId(DefaultFolderType.QuickContacts); StoreObjectId defaultFolderId3 = mailboxSession.GetDefaultFolderId(DefaultFolderType.Favorites); return(new ContactFolders(myContactFolders, defaultFolderId, defaultFolderId2, defaultFolderId3)); }
private void EnsureFolderIds(bool reload) { if (this.folderIds == null || reload) { MyContactFolders.Tracer.TraceDebug((long)this.GetHashCode(), "Loading folder ids from the mailbox"); using (IFolder folder = this.xsoFactory.BindToFolder(this.mailboxSession, DefaultFolderType.Configuration, new PropertyDefinition[] { InternalSchema.MyContactsFolders })) { StoreObjectId[] valueOrDefault = folder.GetValueOrDefault <StoreObjectId[]>(InternalSchema.MyContactsFolders, null); if (valueOrDefault == null) { valueOrDefault = this.GetFolderIds(); this.UpdateFolderIdsProperty(folder, valueOrDefault); } else if (!MyContactFolders.AreSame(valueOrDefault, this.folderIds)) { this.UpdateFolderIdsProperty(folder, valueOrDefault); } this.folderIds = valueOrDefault; } } }