decePubClient/Models/MessageForm.cs

28 lines
1.2 KiB
C#
Raw Normal View History

2022-02-14 01:51:52 +01:00
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
using decePubClient.Models.Types;
using decePubClient.Resources;
namespace decePubClient.Models;
2022-02-14 01:51:37 +01:00
public class MessageForm
{
2022-02-14 01:51:52 +01:00
public string RootMessageId { get; set; }
[Required(ErrorMessageResourceName = ValidationNames.Required, ErrorMessageResourceType = typeof(ErrorMessages))]
public MessageType MessageType { get; set; } = MessageType.Public;
[Required(ErrorMessageResourceName = ValidationNames.Required, ErrorMessageResourceType = typeof(ErrorMessages))]
public ContentType ContentType { get; set; } = ContentType.PlainText;
[StringLength(64, ErrorMessageResourceName = ValidationNames.MaxLength, ErrorMessageResourceType = typeof(ErrorMessages))]
public string Title { get; set; }
[StringLength(5_000, ErrorMessageResourceName = ValidationNames.MaxLength, ErrorMessageResourceType = typeof(ErrorMessages))]
public string Content { get; set; }
public List<UploadMedia> Media { get; set; } = new();
[JsonIgnore, Bindable(false)]
public MediaType MediaType { get; set; } = MediaType.Images;
[JsonIgnore, Bindable(false)]
public bool IsScopeOptionsOpen { get; set; } = false;
2022-02-14 01:51:37 +01:00
}