SocialPub/PrivaPub.ClientModels/LoginForm.cs

38 lines
1.9 KiB
C#
Raw Normal View History

2023-02-19 00:43:43 +01:00
using PrivaPub.ClientModels.Resources;
using PrivaPub.ClientModels.ValidatorAttributes;
2023-02-18 08:52:17 +01:00
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
2023-02-19 00:43:43 +01:00
namespace PrivaPub.ClientModels
2023-02-18 08:52:17 +01:00
{
public class LoginForm
{
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
Display(Name = "Username", ResourceType = typeof(FieldsNameResource)),
StringLength(32, MinimumLength = 3, ErrorMessageResourceName = "StringLengthMinMax", ErrorMessageResourceType = typeof(ErrorsResource)),
NoWhiteSpaces]
public string UserName { get; set; }
[Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)),
DataType(DataType.Password, ErrorMessageResourceName = "InvalidPassword", ErrorMessageResourceType = typeof(ErrorsResource)),
PasswordPropertyText(true),
Display(Name = "Password", ResourceType = typeof(FieldsNameResource)),
StringLength(Constants.MaxPasswordLength, MinimumLength = Constants.MinPasswordLength, ErrorMessageResourceName = "StringLengthMinMax", ErrorMessageResourceType = typeof(ErrorsResource)),
RegularExpression(Constants.PasswordRegex, ErrorMessageResourceName = "InvalidPassword", ErrorMessageResourceType = typeof(ErrorsResource))]
public string Password { get; set; }
[Range(0, 359, ErrorMessageResourceName = nameof(Range), ErrorMessageResourceType = typeof(ErrorsResource))]
public short LightThemeIndexColour { get; set; } = 25;
[Range(0, 359, ErrorMessageResourceName = nameof(Range), ErrorMessageResourceType = typeof(ErrorsResource))]
public short DarkThemeIndexColour { get; set; } = 215;
public short IconsThemeIndexColour { get; set; } = 25;
public bool ThemeIsDarkGray { get; set; } = false;
public bool ThemeIsLightGray { get; set; } = false;
public bool PreferSystemTheming { get; set; } = false;
public bool ThemeIsDarkMode { get; set; } = false;
public string InvitationPassword { get; set; }
}
}