// // BasePost.cs // // Author: // Paul Schneider // // Copyright (c) 2015 GNU GPL // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see . using System; using System.Configuration; using System.Collections.Generic; using Yavsc.Model.Blogs; using System.Linq; using Yavsc.Model.Circles; using System.ComponentModel; using System.ComponentModel.DataAnnotations; namespace Yavsc.Model.Blogs { /// /// Base post. /// public class BasePost: IRating, ITitle { /// /// The identifier. /// long id; /// /// Gets or sets the identifier. /// /// The identifier. [DisplayName("Identifiant numérique de billet")] public long Id { get { return id; } set { id = value; } } /// /// The posted. /// private DateTime posted; /// /// Gets or sets the posted. /// /// The posted. [DisplayName("Date de creation")] public DateTime Posted { get { return posted; } set { posted = value; } } /// /// The modified. /// private DateTime modified; /// /// Gets or sets the modified. /// /// The modified. [DisplayName("Date de modification")] public DateTime Modified { get { return modified; } set { modified = value; } } private string title; /// /// Gets or sets the title. /// /// The title. [DisplayName("Titre du billet")] [StringLength(512)] [RegularExpression("^[^:%&?]*$",ErrorMessage = "Les caratères suivants sont invalides pour un titre: :%&?")] [Required(ErrorMessage = "S'il vous plait, saisissez un titre")] public string Title { get { return title; } set { title = value; } } private string author; /// /// Gets or sets the name of the user. /// /// The name of the user. [StringLength(255)] [DisplayName("Auteur")] public string Author { get { return author; } set { author = value; } } /// /// Gets or sets the photo. /// /// The photo. public string Photo { get; set; } /// /// Gets or sets a value indicating whether this is visible. /// /// true if visible; otherwise, false. public bool Visible { get; set ; } /// /// Gets or sets the rate. /// /// The rate. public int Rate { get; set; } /// /// Gets or sets the circles allowed to read this ticket. /// An empty collection specifies a public post. /// /// The circles. [Display(Name="Cercles autorisés")] public long[] AllowedCircles { get; set; } /// /// Gets or sets the tags. /// /// The tags. public string [] Tags { get; set ; } } }