Click here to Skip to main content
15,886,362 members
Articles / Desktop Programming / Windows Forms

Visual Application Launcher

Rate me:
Please Sign up or sign in to vote.
4.91/5 (37 votes)
23 Jan 2012CPOL23 min read 107.1K   3.7K   116  
A WinForms UI using WCF services, Entity Framework, repository data access, repository caching, Unit of Work, Dependency Injection, and every other buzz work you can think of!
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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions