mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
* V1 Fixes #3541. Checking if clipboard is available on windows. * Fix nuget packages with vulnerabilities.
This commit is contained in:
@@ -1970,7 +1970,21 @@ namespace Terminal.Gui {
|
||||
class WindowsClipboard : ClipboardBase {
|
||||
public WindowsClipboard ()
|
||||
{
|
||||
IsSupported = IsClipboardFormatAvailable (cfUnicodeText);
|
||||
IsSupported = CheckClipboardIsAvailable ();
|
||||
}
|
||||
|
||||
private static bool CheckClipboardIsAvailable ()
|
||||
{
|
||||
// Attempt to open the clipboard
|
||||
if (OpenClipboard (IntPtr.Zero)) {
|
||||
// Clipboard is available
|
||||
// Close the clipboard after use
|
||||
CloseClipboard ();
|
||||
|
||||
return true;
|
||||
}
|
||||
// Clipboard is not available
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool IsSupported { get; }
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.4" />
|
||||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.5" />
|
||||
<PackageReference Include="CsvHelper" Version="33.0.1" />
|
||||
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="3.1.6" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
|
||||
<PackageReference Include="ReportGenerator" Version="5.3.7" />
|
||||
<PackageReference Include="ReportGenerator" Version="5.3.8" />
|
||||
<PackageReference Include="System.Collections" Version="4.3.0" />
|
||||
<PackageReference Include="xunit" Version="2.9.0" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
||||
Reference in New Issue
Block a user