Merge branch 'master' into dev/crutkas/upgradeNuget

This commit is contained in:
Clint Rutkas
2020-11-03 10:57:50 -08:00
committed by GitHub
432 changed files with 7397 additions and 3096 deletions

View File

@@ -2,8 +2,6 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.IO;
using Markdig;
using Markdig.Extensions.Figures;
using Markdig.Extensions.Tables;

View File

@@ -137,6 +137,9 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="System.IO.Abstractions">
<Version>12.2.5</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="..\..\..\codeAnalysis\StyleCop.json">

View File

@@ -4,7 +4,7 @@
using System;
using System.Drawing;
using System.IO;
using System.IO.Abstractions;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using Common;
@@ -21,6 +21,10 @@ namespace Microsoft.PowerToys.PreviewHandler.Markdown
/// </summary>
public class MarkdownPreviewHandlerControl : FormHandlerControl
{
private static readonly IFileSystem FileSystem = new FileSystem();
private static readonly IPath Path = FileSystem.Path;
private static readonly IFile File = FileSystem.File;
/// <summary>
/// Extension to modify markdown AST.
/// </summary>

View File

@@ -47,7 +47,10 @@ namespace Microsoft.PowerToys.PreviewHandler.Svg.Utilities
var elements = doc.Descendants().ToList();
foreach (XElement element in elements)
{
var elementName = element?.Name?.LocalName?.ToLower(CultureInfo.CurrentCulture);
// Using Invariant since we are doing an exact match for HTML tags and we want it to behave the same in every culture
#pragma warning disable CA1308 // Normalize strings to uppercase
var elementName = element?.Name?.LocalName?.ToLowerInvariant();
#pragma warning restore CA1308 // Normalize strings to uppercase
if (elementName != null && blockedElementsName.ContainsKey(elementName))
{
foundBlockedElement = true;

View File

@@ -166,7 +166,9 @@ namespace Microsoft.PowerToys.ThumbnailHandler.Svg
{0}
</body>
</html>";
return string.Format(CultureInfo.CurrentCulture, html, svg);
// Using InvariantCulture since this should be displayed as it is
return string.Format(CultureInfo.InvariantCulture, html, svg);
}
/// <summary>

View File

@@ -148,6 +148,9 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="System.IO.Abstractions">
<Version>12.2.5</Version>
</PackageReference>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View File

@@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;

View File

@@ -54,6 +54,7 @@ namespace PreviewHandlerCommon
if (name != null && name.Equals(DISPIDAMBIENTDLCONTROL, StringComparison.CurrentCulture))
{
// Using InvariantCulture since this is used for web browser configurations
result = Convert.ToInt32(
WebBrowserDownloadControlFlags.DLIMAGES |
WebBrowserDownloadControlFlags.PRAGMA_NO_CACHE |
@@ -66,7 +67,7 @@ namespace PreviewHandlerCommon
WebBrowserDownloadControlFlags.NO_DLACTIVEXCTLS |
WebBrowserDownloadControlFlags.NO_RUNACTIVEXCTLS |
WebBrowserDownloadControlFlags.NO_BEHAVIORS |
WebBrowserDownloadControlFlags.SILENT, CultureInfo.CurrentCulture);
WebBrowserDownloadControlFlags.SILENT, CultureInfo.InvariantCulture);
}
else
{

View File

@@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.
using System;
using System.IO;
using System.Windows.Forms;
namespace Common

View File

@@ -40,8 +40,8 @@
<Item ItemId=";FileExplorer_Admin_Restart_Warning_Description" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Some of the File Explorer modules could not be turned off/on as per your settings. Please restart PowerToys as admin for the changes to take place.]]></Val>
<Tgt Cat="Text" Stat="Update" Orig="New">
<Val><![CDATA[A Fájlkezelő néhány modulja nem regisztrálható, vagy a modulok regisztrációja nem törölhető a beállításoknak megfelelően. A módosítások érvénybe léptetéséhez indítsa újra a PowerToyst rendszergazdaként.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[A Fájlkezelő néhány modulja nem kapcsolható be vagy ki a beállításoknak megfelelően. A módosítások érvénybe léptetéséhez indítsa újra a PowerToyst rendszergazdaként.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Some of the File Explorer modules could not be registered/unregistered as per your settings. Please restart PowerToys as admin for the changes to take place.]]></Val>
@@ -70,7 +70,7 @@
<Item ItemId=";FileExplorer_Admin_Restart_Warning_Title" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Couldn't modify File Explorer modules]]></Val>
<Tgt Cat="Text" Stat="Update" Orig="New">
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Nem sikerült módosítani a Fájlkezelő moduljait]]></Val>
</Tgt>
<Prev Cat="Text">

View File

@@ -40,8 +40,8 @@
<Item ItemId=";FileExplorer_Admin_Restart_Warning_Description" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Some of the File Explorer modules could not be turned off/on as per your settings. Please restart PowerToys as admin for the changes to take place.]]></Val>
<Tgt Cat="Text" Stat="Update" Orig="New">
<Val><![CDATA[Non è stato possibile eseguire l'operazione di registrazione/annullamento della registrazione per alcuni moduli di Esplora file in base alle impostazioni definite. Per apportare modifiche, riavviare PowerToys come amministratore.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Non è stato possibile disattivare/attivare alcuni moduli di Esplora file in base alle impostazioni definite. Per apportare modifiche, riavviare PowerToys come amministratore.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Some of the File Explorer modules could not be registered/unregistered as per your settings. Please restart PowerToys as admin for the changes to take place.]]></Val>
@@ -70,7 +70,7 @@
<Item ItemId=";FileExplorer_Admin_Restart_Warning_Title" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Couldn't modify File Explorer modules]]></Val>
<Tgt Cat="Text" Stat="Update" Orig="New">
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Non è stato possibile modificare i moduli di Esplora file]]></Val>
</Tgt>
<Prev Cat="Text">

View File

@@ -40,8 +40,8 @@
<Item ItemId=";FileExplorer_Admin_Restart_Warning_Description" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Some of the File Explorer modules could not be turned off/on as per your settings. Please restart PowerToys as admin for the changes to take place.]]></Val>
<Tgt Cat="Text" Stat="Update" Orig="New">
<Val><![CDATA[いくつかの File Explorer モジュールを設定どおりに登録または登録解除することができませんでした。この変更を有効にするには、管理者として PowerToys を再起動してください。]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[いくつかのエクスプローラー モジュールを設定どおりにオフまたはオンにすることができませんでした。この変更を有効にするには、管理者として PowerToys を再起動してください。]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Some of the File Explorer modules could not be registered/unregistered as per your settings. Please restart PowerToys as admin for the changes to take place.]]></Val>
@@ -70,8 +70,8 @@
<Item ItemId=";FileExplorer_Admin_Restart_Warning_Title" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Couldn't modify File Explorer modules]]></Val>
<Tgt Cat="Text" Stat="Update" Orig="New">
<Val><![CDATA[File Explorer モジュール変更できませんでした]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[エクスプローラー モジュール変更失敗]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Failed to modify File Explorer modules]]></Val>

View File

@@ -40,8 +40,8 @@
<Item ItemId=";FileExplorer_Admin_Restart_Warning_Description" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Some of the File Explorer modules could not be turned off/on as per your settings. Please restart PowerToys as admin for the changes to take place.]]></Val>
<Tgt Cat="Text" Stat="Update" Orig="New">
<Val><![CDATA[설정에 따라 일부 파일 탐색기 모듈을 등록하거나 등록 취소할 수 없습니다. 변경 내용을 적용하려면 관리자 권한으로 PowerToys를 다시 시작하세요.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[설정에 따라 일부 파일 탐색기 모듈을 끄거나 켤 수 없습니다. 변경 내용을 적용하려면 관리자 권한으로 PowerToys를 다시 시작하세요.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Some of the File Explorer modules could not be registered/unregistered as per your settings. Please restart PowerToys as admin for the changes to take place.]]></Val>
@@ -70,8 +70,8 @@
<Item ItemId=";FileExplorer_Admin_Restart_Warning_Title" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Couldn't modify File Explorer modules]]></Val>
<Tgt Cat="Text" Stat="Update" Orig="New">
<Val><![CDATA[파일 탐색기 모듈을 수정하지 못했습니다.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[파일 탐색기 모듈을 수정할 수 없음]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Failed to modify File Explorer modules]]></Val>

View File

@@ -110,7 +110,7 @@
<Str Cat="Text">
<Val><![CDATA[Markdown Previewer]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Markdown-voorbeeldfunctie]]></Val>
<Val><![CDATA[Markdown Previewer]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -119,7 +119,7 @@
<Str Cat="Text">
<Val><![CDATA[Markdown Previewer]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Markdown-voorbeeldfunctie]]></Val>
<Val><![CDATA[Markdown Previewer]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -128,7 +128,7 @@
<Str Cat="Text">
<Val><![CDATA[Svg Previewer]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[SVG-voorbeeldweergave]]></Val>
<Val><![CDATA[SVG Previewer]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -137,7 +137,7 @@
<Str Cat="Text">
<Val><![CDATA[SVG Previewer]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[SVG-voorbeeldweergave]]></Val>
<Val><![CDATA[SVG Previewer]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />

View File

@@ -40,8 +40,8 @@
<Item ItemId=";FileExplorer_Admin_Restart_Warning_Description" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Some of the File Explorer modules could not be turned off/on as per your settings. Please restart PowerToys as admin for the changes to take place.]]></Val>
<Tgt Cat="Text" Stat="Update" Orig="New">
<Val><![CDATA[Niektórych modułów Eksploratora plików nie można było zarejestrować/wyrejestrować zgodnie z Twoimi ustawieniami. Ponownie uruchom program PowerToys jako administrator, aby wprowadzić zmiany.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Niektórych modułów Eksploratora plików nie można było wyłączyć/włączyć zgodnie z Twoimi ustawieniami. Ponownie uruchom program PowerToys jako administrator, aby wprowadzić zmiany.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Some of the File Explorer modules could not be registered/unregistered as per your settings. Please restart PowerToys as admin for the changes to take place.]]></Val>
@@ -70,8 +70,8 @@
<Item ItemId=";FileExplorer_Admin_Restart_Warning_Title" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Couldn't modify File Explorer modules]]></Val>
<Tgt Cat="Text" Stat="Update" Orig="New">
<Val><![CDATA[Nie można zmodyfikować modułów Eksploratora plików]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Nie można było zmodyfikować modułów Eksploratora plików]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Failed to modify File Explorer modules]]></Val>

View File

@@ -40,8 +40,8 @@
<Item ItemId=";FileExplorer_Admin_Restart_Warning_Description" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Some of the File Explorer modules could not be turned off/on as per your settings. Please restart PowerToys as admin for the changes to take place.]]></Val>
<Tgt Cat="Text" Stat="Update" Orig="New">
<Val><![CDATA[O registo ou a anulação de registo de alguns dos módulos do Explorador de Ficheiros não foi possível de acordo com as suas definições. Reinicie o PowerToys como administrador para as alterações produzirem efeito.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Não foi possível desativar/ativar os módulos do Explorador de Ficheiros de acordo com as suas definições. Reinicie o PowerToys como administrador para as alterações entrarem em vigor.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Some of the File Explorer modules could not be registered/unregistered as per your settings. Please restart PowerToys as admin for the changes to take place.]]></Val>
@@ -53,7 +53,7 @@
<Str Cat="Text">
<Val><![CDATA[Don't show again]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Não mostrar novamente]]></Val>
<Val><![CDATA[Não voltar mostrar]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -61,14 +61,17 @@
<Item ItemId=";FileExplorer_Admin_Restart_Warning_Open_Settings" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Open Settings]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Abrir Definições]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
</Item>
<Item ItemId=";FileExplorer_Admin_Restart_Warning_Title" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Couldn't modify File Explorer modules]]></Val>
<Tgt Cat="Text" Stat="Update" Orig="New">
<Val><![CDATA[Falha ao modificar os módulos do Explorador de Ficheiros]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Não foi possível modificar os módulos do Explorador de Ficheiros]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Failed to modify File Explorer modules]]></Val>

View File

@@ -40,8 +40,8 @@
<Item ItemId=";FileExplorer_Admin_Restart_Warning_Description" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Some of the File Explorer modules could not be turned off/on as per your settings. Please restart PowerToys as admin for the changes to take place.]]></Val>
<Tgt Cat="Text" Stat="Update" Orig="New">
<Val><![CDATA[Не удалось зарегистрировать или отменить регистрацию некоторых модулей проводника в соответствии с вашими настройками. Чтобы изменения вступили в силу, перезапустите PowerToys от имени администратора.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Не удалось включить или отключить некоторые модули проводника в соответствии с вашими настройками. Чтобы изменения вступили в силу, перезапустите PowerToys от имени администратора.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Some of the File Explorer modules could not be registered/unregistered as per your settings. Please restart PowerToys as admin for the changes to take place.]]></Val>
@@ -70,7 +70,7 @@
<Item ItemId=";FileExplorer_Admin_Restart_Warning_Title" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Couldn't modify File Explorer modules]]></Val>
<Tgt Cat="Text" Stat="Update" Orig="New">
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Не удалось изменить модули проводника]]></Val>
</Tgt>
<Prev Cat="Text">

View File

@@ -40,8 +40,8 @@
<Item ItemId=";FileExplorer_Admin_Restart_Warning_Description" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Some of the File Explorer modules could not be turned off/on as per your settings. Please restart PowerToys as admin for the changes to take place.]]></Val>
<Tgt Cat="Text" Stat="Update" Orig="New">
<Val><![CDATA[Vissa av modulerna i Utforskaren kunde inte registreras/avregistreras enligt dina inställningar. Starta om PowerToys som administratör för att ändringarna ska börja gälla.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Vissa av modulerna i Utforskaren kunde inte stängas av/sättas på enligt dina inställningar. Starta om PowerToys som administratör att ändringarna kan börja gälla.]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Some of the File Explorer modules could not be registered/unregistered as per your settings. Please restart PowerToys as admin for the changes to take place.]]></Val>
@@ -70,7 +70,7 @@
<Item ItemId=";FileExplorer_Admin_Restart_Warning_Title" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Couldn't modify File Explorer modules]]></Val>
<Tgt Cat="Text" Stat="Update" Orig="New">
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Det gick inte att ändra modulerna för Utforskaren]]></Val>
</Tgt>
<Prev Cat="Text">

View File

@@ -40,8 +40,8 @@
<Item ItemId=";FileExplorer_Admin_Restart_Warning_Description" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Some of the File Explorer modules could not be turned off/on as per your settings. Please restart PowerToys as admin for the changes to take place.]]></Val>
<Tgt Cat="Text" Stat="Update" Orig="New">
<Val><![CDATA[某些文件资源管理器模块无法根据你的设置进行注册/取消注册。为了让更改生效,请以管理员身份重启 PowerToys。]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[某些文件资源管理器模块无法根据你的设置进行禁用/启用。为了让更改生效,请以管理员身份重启 PowerToys。]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Some of the File Explorer modules could not be registered/unregistered as per your settings. Please restart PowerToys as admin for the changes to take place.]]></Val>
@@ -70,7 +70,7 @@
<Item ItemId=";FileExplorer_Admin_Restart_Warning_Title" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Couldn't modify File Explorer modules]]></Val>
<Tgt Cat="Text" Stat="Update" Orig="New">
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[无法修改文件资源管理器模块]]></Val>
</Tgt>
<Prev Cat="Text">

View File

@@ -40,8 +40,8 @@
<Item ItemId=";FileExplorer_Admin_Restart_Warning_Description" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Some of the File Explorer modules could not be turned off/on as per your settings. Please restart PowerToys as admin for the changes to take place.]]></Val>
<Tgt Cat="Text" Stat="Update" Orig="New">
<Val><![CDATA[有一些檔案總管模組無法依據您的設定註冊/取消註冊。請以系統管理員身分重新啟動 PowerToys如此變更才會生效。]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[無法依據您的設定開啟/關閉某些檔案總管模組。請以系統管理員身分重新啟動 PowerToys讓變更生效。]]></Val>
</Tgt>
<Prev Cat="Text">
<Val><![CDATA[Some of the File Explorer modules could not be registered/unregistered as per your settings. Please restart PowerToys as admin for the changes to take place.]]></Val>
@@ -70,7 +70,7 @@
<Item ItemId=";FileExplorer_Admin_Restart_Warning_Title" ItemType="0;.resx" PsrId="211" Leaf="true">
<Str Cat="Text">
<Val><![CDATA[Couldn't modify File Explorer modules]]></Val>
<Tgt Cat="Text" Stat="Update" Orig="New">
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[無法修改檔案總管模組]]></Val>
</Tgt>
<Prev Cat="Text">