namespace VAL.Model.Entities { using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ComponentModel; using System.ComponentModel.DataAnnotations; public enum FileTypeEnum { Executable = 1, Database = 2, Miscellaneous = 3 } [MetadataType(typeof(FileMetadata))] [Serializable] public partial class File { #region Internal MetaData class internal class FileMetadata { #region Primitive Properties [Required(ErrorMessage = "You must enter a name for the file")] [DisplayName("Name:")] [StringLength(50)] public virtual string Name { get; set; } [Required(ErrorMessage = "You must enter a path for the file")] [DisplayName("Path:")] [StringLength(150)] public virtual string Path { get; set; } [Required(ErrorMessage = "You must enter a description for the file")] [DisplayName("Description:")] [StringLength(50)] public virtual string Description { get; set; } [DisplayName("Distribute To:")] [StringLength(150)] public virtual string DistributeTo { get; set; } [DisplayName("Notes:")] [StringLength(1000)] public virtual string Notes { get; set; } [DisplayName("Workgroup:")] [StringLength(50)] public virtual string Workgroup { get; set; } [DisplayName("Command:")] [StringLength(50)] public virtual string Command { get; set; } [DisplayName("Icon:")] [Required(ErrorMessage = "You must select an icon for the file")] public virtual byte[] Icon { get; set; } [DisplayName("File Type Id:")] [Required(ErrorMessage = "You must select a file type")] [Range(1, 4, ErrorMessage= "File type identifier must be between 1 and 4")] public virtual int FileTypeID { get; set; } #endregion } #endregion public string FullName { get { return this.Path + this.Name; } } public override string ToString() { return this.Description; } } }
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)