Skip to content

Commit

Permalink
新增 将数学运算结果复制到剪贴板
Browse files Browse the repository at this point in the history
  • Loading branch information
MakesYT committed Apr 28, 2024
1 parent 0d2caf0 commit 4226c57
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
13 changes: 13 additions & 0 deletions Core.Window/SearchItemTool.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Diagnostics;
using System.IO;
using System.Windows;
using CommunityToolkit.Mvvm.Messaging;
using Core.SDKs.CustomScenario;
using Core.SDKs.Services;
Expand Down Expand Up @@ -80,6 +81,18 @@ public void OpenFile(SearchViewItem? searchViewItem)
});
break;
}
case FileType.数学运算:
{
var tcs = new TaskCompletionSource<bool>();
var thread = new Thread(() =>
{
Clipboard.SetText(searchViewItem.ItemDisplayName.Remove(0,1));
});
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
break;
}

case FileType.文件夹:
{
if (searchViewItem.Arguments == null)
Expand Down
2 changes: 2 additions & 0 deletions KitopiaAvalonia/Converter/SearchWindow/SearchItemToInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public class SearchItemToInfo : IValueConverter
info.Append(item.OnlyKey);
break;
case FileType.数学运算:
info.Append($"点击将{item.ItemDisplayName.Remove(0,1)}复制到剪贴板");
break;
case FileType.剪贴板图像:
case FileType.None:
break;
Expand Down
2 changes: 1 addition & 1 deletion KitopiaAvalonia/KitopiaAvalonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<ApplicationIcon>Assets\icon.ico</ApplicationIcon>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<DebugType Condition="'$(Configuration)' == 'Release'">none</DebugType>
<Version>0.0.2.041</Version>
<Version>0.0.2.042</Version>
</PropertyGroup>
<ItemGroup>
<AvaloniaResource Include="Assets\FluentSystemIcons-Filled.ttf"/>
Expand Down
2 changes: 1 addition & 1 deletion PinyinM.NET

0 comments on commit 4226c57

Please sign in to comment.