public void SetGroupPinState(UserMailboxLocator user, GroupMailboxLocator group, bool isPinned, bool isModernGroupsNewArchitecture)
 {
     using (IAssociationStore associationStore = this.storeProviderBuilder.Create(user, this.PerformanceTracker))
     {
         this.LogCommandExecution(isPinned ? "PinGroup" : "UnpinGroup", group, new UserMailboxLocator[]
         {
             user
         });
         GroupAssociationAdaptor masterAdaptor    = new GroupAssociationAdaptor(associationStore, this.adSession, user);
         SetGroupPinState        setGroupPinState = new SetGroupPinState(this.Logger, null, isPinned, masterAdaptor, group, this.PerformanceTracker, isModernGroupsNewArchitecture);
         setGroupPinState.Execute();
     }
 }
 public IEnumerable <GroupMailbox> GetPinnedGroups(UserMailboxLocator user, bool loadAllDetails = false)
 {
     using (IAssociationStore storeProvider = this.storeProviderBuilder.Create(user, this.PerformanceTracker))
     {
         GroupAssociationAdaptor          adaptor         = new GroupAssociationAdaptor(storeProvider, this.adSession, user);
         GetPinAssociations               command         = new GetPinAssociations(adaptor);
         IEnumerable <MailboxAssociation> pinAssociations = command.Execute(null);
         IEnumerable <GroupMailbox>       mailboxes       = this.mailboxCollectionBuilder.BuildGroupMailboxes(pinAssociations, loadAllDetails);
         foreach (GroupMailbox mailbox in mailboxes)
         {
             yield return(mailbox);
         }
     }
     yield break;
 }