Exemplo n.º 1
0
    public void UpdateEmail(string newEmail)
    {
        EmailAddress = newEmail;

        TryCreateUser(EmailAddress,
                      Password, Username, ProfilePicture);

        OnUserInformationChanged?.Invoke(this);
    }
Exemplo n.º 2
0
    public void UpdateProfilePicture(string pic)
    {
        var bytes = File.ReadAllBytes(pic);
        var loc   = UserFile.UserFolder + Username + "/userImage.img";

        File.WriteAllBytes(loc, bytes);

        TryCreateUser(EmailAddress,
                      Password, Username);

        OnUserInformationChanged?.Invoke(this);
    }
Exemplo n.º 3
0
    public void UpdateUsername(string newName)
    {
        FileSystem.TryChangeDirectoryName(
            UserFile.UserFolder + CurrentUser.Username,
            UserFile.UserFolder + newName);

        Username = newName;

        TryCreateUser(EmailAddress,
                      Password, Username, ProfilePicture);

        OnUserInformationChanged?.Invoke(this);
    }
Exemplo n.º 4
0
    public void UpdatePassword(string confirmedPassword, string newPass)
    {
        if (confirmedPassword != Password)
        {
            return;
        }

        Password = newPass;

        TryCreateUser(EmailAddress,
                      Password, Username, ProfilePicture);

        OnUserInformationChanged?.Invoke(this);
    }