예제 #1
0
        private static void RefreshAllAccounts()
        {
            var accountIDs = TBRAccountRoot.GetAllAccountIDs();

            foreach (var accountID in accountIDs)
            {
                var accountRoot = TBRAccountRoot.RetrieveFromDefaultLocation(accountID);
                accountRoot.Account.StoreAccountToRoot();
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: michlG/Caloom
        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();
        }
예제 #3
0
        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);
            }
        }
예제 #4
0
        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();
            }
        }