Skip to content

Commit

Permalink
Optimize display content
Browse files Browse the repository at this point in the history
  • Loading branch information
emako committed Dec 16, 2024
1 parent e191497 commit 2ec8db1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public bool CanHandle(string path)

public void Prepare(string path, ContextObject context)
{
context.SetPreferredSizeFit(new Size { Width = 1000, Height = 800 }, 0.8);
context.SetPreferredSizeFit(new Size { Width = 1200, Height = 800 }, 0.8);
}

public void View(string path, ContextObject context)
Expand All @@ -71,7 +71,7 @@ public void View(string path, ContextObject context)
MessageBoxResult result = MessageBox.Show(
"""
Be careful - files from the Internet can contain viruses.
The MS Office interface prevents loading in Protected View.
The Office interface prevents loading in Protected View.
Would you like OfficeViewer-Native to unblock the ZoneIdentifier of Internet?
""",
Expand All @@ -82,11 +82,16 @@ Would you like OfficeViewer-Native to unblock the ZoneIdentifier of Internet?

if (result == MessageBoxResult.Yes)
{
ZoneIdentifierManager.UnblockZone(path);
_ = ZoneIdentifierManager.UnblockZone(path);
}
else
{
context.ViewerContent = new Label() { Content = "The MS Office interface prevents loading in Protected View." };
context.ViewerContent = new Label()
{
Content = "The Office interface prevents loading in Protected View.",
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Center,
};
context.Title = $"[PROTECTED VIEW] {Path.GetFileName(path)}";
context.IsBusy = false;
return;
Expand Down

0 comments on commit 2ec8db1

Please sign in to comment.