peek: use common

This commit is contained in:
seraphima
2023-04-25 12:47:02 +02:00
parent 5ba4b973d7
commit f02402ae9c
3 changed files with 4 additions and 22 deletions

View File

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\Version.props" />
<PropertyGroup>
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
@@ -17,7 +17,6 @@
<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.0.0" />
<PackageReference Include="Markdig.Signed" Version="0.31.0" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.2.221116.1" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.755" />
<PackageReference Include="System.Drawing.Common" Version="7.0.0" />
@@ -25,6 +24,7 @@
<ItemGroup>
<ProjectReference Include="..\..\..\common\Common.UI\Common.UI.csproj" />
<ProjectReference Include="..\..\..\common\FilePreviewCommon\FilePreviewCommon.csproj" />
<ProjectReference Include="..\..\..\settings-ui\Settings.UI.Library\Settings.UI.Library.csproj" />
<ProjectReference Include="..\Peek.Common\Peek.Common.csproj" />
<ProjectReference Include="..\WIC\WIC.csproj" />

View File

@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
@@ -39,23 +39,5 @@ namespace Peek.FilePreviewer.Previewers
File.WriteAllText(filename, markdownHTML);
return filename;
}
// Cleanup the previously created tmp html files from svg files bigger than 2MB.
public static void CleanupWebView2UserDataFolder(string folder)
{
try
{
// Cleanup temp dir
var dir = new DirectoryInfo(folder);
foreach (var file in dir.EnumerateFiles("*.html"))
{
file.Delete();
}
}
catch (Exception)
{
}
}
}
}

View File

@@ -43,7 +43,7 @@ namespace Peek.FilePreviewer.Previewers
public void Dispose()
{
WebViewHelper.CleanupWebView2UserDataFolder(tempDataFolder);
FilePreviewCommon.Helper.CleanupTempDir(tempDataFolder);
GC.SuppressFinalize(this);
}