Exemplo n.º 1
0
 //##########################################################################################################################################
 public FileInfoModel(string fileName)
 {
     this.FileInfo     = new FileInfo(fileName);
     this.MetaInfo     = GetMetaInfo(this.FileInfo);
     this.FileCategory = this.MetaInfo.FileExtention == null
                         ? DictSupportedTypes.GetFileCategory(this.FileInfo.Extension)
                         : this.MetaInfo.FileExtention;
 }
Exemplo n.º 2
0
        //##########################################################################################################################################


        /// <summary>
        /// Get MetaInfo from File
        /// </summary>
        /// <param name="extension"></param>
        /// <returns></returns>
        private dynamic GetMetaInfo(FileInfo fileInfo)
        {
            switch (DictSupportedTypes.GetFileCategory(fileInfo.Extension.ToLower()))
            {
            case EnumFileCategory.Audio:
                return(new MetaInfoAudioModel(fileInfo));

            case EnumFileCategory.Video:
                return(new MetaInfoVideoModel(fileInfo));

            case EnumFileCategory.Graphic:
                return(new MetaInfoGraphicModel(fileInfo));

            default:
                return(null);
            }
        }