示例#1
0
        public FileType GetFileType()
        {
            if (string.IsNullOrEmpty(Location))
            {
                return(FileType.Unknown);
            }
            var category = FTT.GetFileCategory(Location);

            switch (category)
            {
            case FileCategory.Archive: return(FileType.Archive);

            case FileCategory.Audio: return(FileType.Audio);

            case FileCategory.Code: return(FileType.Code);

            case FileCategory.Document: return(FileType.Document);

            case FileCategory.Image: return(FileType.Image);

            case FileCategory.Presentation: return(FileType.Presentation);

            case FileCategory.PDF: return(FileType.PDF);

            case FileCategory.Spreadsheet: return(FileType.Spreadsheet);

            case FileCategory.Video: return(FileType.Video);

            default:
                return(FileType.Text);
            }
        }
 public static bool IsDocumentFile(string filename)
 {
     return(FTT.GetFileCategory(filename) == FileCategory.Document);
 }
示例#3
0
 public static bool IsVideoFile(string filename)
 {
     return(FTT.GetFileCategory(filename) == FileCategory.Video);
 }
示例#4
0
 public static bool IsAudioFile(string filename)
 {
     return(FTT.GetFileCategory(filename) == FileCategory.Audio);
 }
示例#5
0
 public static bool IsImageFile(string filename)
 {
     return(FTT.GetFileCategory(filename) == FileCategory.Image);
 }