示例#1
0
        /// <summary>
        /// Obtains and changes the email of the registered user.
        /// </summary>
        /// <param name="userContext"></param>
        /// <param name="newEmailAddress"></param>
        public void changeEmail(UserContext userContext,
                                String newEmailAddress)
        {
            FieldInfoSingle emailAddress = (FieldInfoSingle)registerService.getEmail(userContext);

            System.Console.WriteLine("\tExisting email address is: ", emailAddress.value);

            System.Console.WriteLine("\tChanging email address to: ", newEmailAddress);
            FieldInfoSingle newEmail = new FieldInfoSingle();

            newEmail.name        = "EMAIL";
            newEmail.value       = newEmailAddress;
            newEmail.displayName = "EMAIL";
            newEmail.isOptional  = false;

            registerService.updateEmail(userContext, newEmail);
        }