From a4869174c478f220e10f6837db24301a109355e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A3=8A?= Date: Sat, 11 Sep 2021 15:32:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E6=A1=A3=E7=B1=BB=E5=9E=8B=E5=92=8C?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TextLocator/App.xaml.cs | 14 ++++++-------- TextLocator/Enums/FileType.cs | 17 ++++++----------- TextLocator/MainWindow.xaml | 22 +++++++++++++++++----- TextLocator/MainWindow.xaml.cs | 28 +++++++++++++++------------- TextLocator/Util/FileTypeUtil.cs | 22 +--------------------- TextLocator/Util/FileUtil.cs | 12 ++++++------ 6 files changed, 51 insertions(+), 64 deletions(-) diff --git a/TextLocator/App.xaml.cs b/TextLocator/App.xaml.cs index 229acfd..345fbf2 100644 --- a/TextLocator/App.xaml.cs +++ b/TextLocator/App.xaml.cs @@ -25,23 +25,21 @@ namespace TextLocator try { // Word服务 - FileInfoServiceFactory.Register(FileType.Word类型, new WordFileService()); + FileInfoServiceFactory.Register(FileType.Word文档, new WordFileService()); // Excel服务 - FileInfoServiceFactory.Register(FileType.Excel类型, new ExcelFileService()); + FileInfoServiceFactory.Register(FileType.Excel表格, new ExcelFileService()); // PowerPoint服务 - FileInfoServiceFactory.Register(FileType.PowerPoint类型, new PowerPointFileService()); + FileInfoServiceFactory.Register(FileType.PPT演示文稿, new PowerPointFileService()); // PDF服务 - FileInfoServiceFactory.Register(FileType.PDF类型, new PdfFileService()); + FileInfoServiceFactory.Register(FileType.PDF文档, new PdfFileService()); // HTML或XML服务 - FileInfoServiceFactory.Register(FileType.HTML和XML类型, new XmlFileService()); + FileInfoServiceFactory.Register(FileType.HTML和XML, new XmlFileService()); // 常用图片服务 FileInfoServiceFactory.Register(FileType.常用图片, new NoTextFileService()); // 程序员服务 FileInfoServiceFactory.Register(FileType.代码文件, new DevelopFileService()); // 纯文本服务 - FileInfoServiceFactory.Register(FileType.纯文本, new TxtFileService()); - // 其他类型服务 - FileInfoServiceFactory.Register(FileType.其他类型, new NoTextFileService()); + FileInfoServiceFactory.Register(FileType.文本文件, new TxtFileService()); } catch (Exception ex) { diff --git a/TextLocator/Enums/FileType.cs b/TextLocator/Enums/FileType.cs index 73ed1eb..fa7bf2d 100644 --- a/TextLocator/Enums/FileType.cs +++ b/TextLocator/Enums/FileType.cs @@ -11,27 +11,27 @@ namespace TextLocator.Enums /// Word /// [Description("doc,docx")] - Word类型, + Word文档, /// /// Excel /// [Description("xls,xlsx")] - Excel类型, + Excel表格, /// /// PowerPoint /// [Description("ppt,pptx")] - PowerPoint类型, + PPT演示文稿, /// /// PDF /// [Description("pdf")] - PDF类型, + PDF文档, /// /// XML和html /// [Description("html,xml")] - HTML和XML类型, + HTML和XML, /// /// 常用图片 /// @@ -46,11 +46,6 @@ namespace TextLocator.Enums /// 纯文本 /// [Description("txt")] - 纯文本, - /// - /// 其他类型 - /// - [Description()] - 其他类型 + 文本文件 } } diff --git a/TextLocator/MainWindow.xaml b/TextLocator/MainWindow.xaml index 044f8bb..54a11eb 100644 --- a/TextLocator/MainWindow.xaml +++ b/TextLocator/MainWindow.xaml @@ -71,15 +71,27 @@ - + - + + +