|
20 | 20 | using System.Linq; |
21 | 21 | using System.Windows; |
22 | 22 |
|
23 | | -namespace QuickLook.Plugin.OfficeViewer |
| 23 | +namespace QuickLook.Plugin.OfficeViewer; |
| 24 | + |
| 25 | +public class Plugin : IViewer |
24 | 26 | { |
25 | | - public class Plugin : IViewer |
26 | | - { |
27 | | - private readonly string[] _formats = |
28 | | - [".doc", ".docm", ".docx", ".rtf", ".xls", ".xlsx", ".xlsm", ".pptx", ".pptm", ".potx", ".potm"]; |
| 27 | + private readonly string[] _formats = |
| 28 | + [".doc", ".docm", ".docx", ".rtf", ".xls", ".xlsx", ".xlsm", ".pptx", ".pptm", ".potx", ".potm"]; |
29 | 29 |
|
30 | | - public int Priority => 0; |
| 30 | + public int Priority => 0; |
31 | 31 |
|
32 | | - public void Init() |
33 | | - { |
34 | | - SyncfusionKey.Register(); |
35 | | - } |
| 32 | + public void Init() |
| 33 | + { |
| 34 | + SyncfusionKey.Register(); |
| 35 | + } |
36 | 36 |
|
37 | | - public bool CanHandle(string path) |
38 | | - { |
39 | | - return !Directory.Exists(path) && _formats.Contains(Path.GetExtension(path).ToLower()); |
40 | | - } |
| 37 | + public bool CanHandle(string path) |
| 38 | + { |
| 39 | + return !Directory.Exists(path) && _formats.Contains(Path.GetExtension(path).ToLower()); |
| 40 | + } |
41 | 41 |
|
42 | | - public void Prepare(string path, ContextObject context) |
43 | | - { |
44 | | - context.SetPreferredSizeFit(new Size { Width = 1920, Height = 1440 }, 0.9d); |
45 | | - } |
| 42 | + public void Prepare(string path, ContextObject context) |
| 43 | + { |
| 44 | + context.SetPreferredSizeFit(new Size { Width = 1920, Height = 1440 }, 0.9d); |
| 45 | + } |
46 | 46 |
|
47 | | - public void View(string path, ContextObject context) |
48 | | - { |
49 | | - var viewer = SyncfusionControl.Open(path); |
| 47 | + public void View(string path, ContextObject context) |
| 48 | + { |
| 49 | + var viewer = SyncfusionControl.Open(path); |
50 | 50 |
|
51 | | - context.ViewerContent = viewer; |
52 | | - context.Title = $"{Path.GetFileName(path)}"; |
| 51 | + context.ViewerContent = viewer; |
| 52 | + context.Title = $"{Path.GetFileName(path)}"; |
53 | 53 |
|
54 | | - context.IsBusy = false; |
55 | | - } |
| 54 | + context.IsBusy = false; |
| 55 | + } |
56 | 56 |
|
57 | | - public void Cleanup() |
58 | | - { |
59 | | - } |
| 57 | + public void Cleanup() |
| 58 | + { |
60 | 59 | } |
61 | 60 | } |
0 commit comments