private static void RefreshAllAccounts() { var accountIDs = TBRAccountRoot.GetAllAccountIDs(); foreach (var accountID in accountIDs) { var accountRoot = TBRAccountRoot.RetrieveFromDefaultLocation(accountID); accountRoot.Account.StoreAccountToRoot(); } }
private static void AddLoginToAccount(string loginUrlID, string accountID) { TBRAccountRoot accountRoot = TBRAccountRoot.RetrieveFromDefaultLocation(accountID); TBLoginInfo loginInfo = TBLoginInfo.CreateDefault(); loginInfo.OpenIDUrl = loginUrlID; accountRoot.Account.Logins.CollectionContent.Add(loginInfo); accountRoot.Account.StoreAccountToRoot(); }
private static void UpdateAccountAndGroups(string accountEmail) { string emailID = TBREmailRoot.GetIDFromEmailAddress(accountEmail); TBREmailRoot emailRoot = TBREmailRoot.RetrieveFromDefaultLocation(emailID); TBRAccountRoot accountRoot = TBRAccountRoot.RetrieveFromDefaultLocation(emailRoot.Account.ID); foreach (var groupRole in accountRoot.Account.GroupRoleCollection.CollectionContent) { TBRGroupRoot groupRoot = TBRGroupRoot.RetrieveFromDefaultLocation(groupRole.GroupID); RefreshAccountGroupMemberships.Execute(new RefreshAccountGroupMembershipsParameters { AccountID = accountRoot.Account.ID, GroupRoot = groupRoot }); InformationContext.ProcessAndClearCurrent(); InformationContext.Current.InitializeCloudStorageAccess(Properties.Settings.Default.CurrentActiveContainerName); } }
public static void SetAllInvitedViewerMembersAsFullCollaborators() { var accountIDs = TBRAccountRoot.GetAllAccountIDs(); foreach (var acctID in accountIDs) { TBRAccountRoot accountRoot = TBRAccountRoot.RetrieveFromDefaultLocation(acctID); TBAccount account = accountRoot.Account; foreach (var grpRole in account.GroupRoleCollection.CollectionContent) { if (TBCollaboratorRole.IsRoleStatusValidMember(grpRole.RoleStatus) == false) { grpRole.RoleStatus = TBCollaboratorRole.RoleStatusMemberValue; } if (grpRole.GroupRole == TBCollaboratorRole.ViewerRoleValue) { grpRole.GroupRole = TBCollaboratorRole.CollaboratorRoleValue; } } account.StoreAccountToRoot(); } }