This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Project> | |
| <PropertyGroup> | |
| <EnableMsixTooling>true</EnableMsixTooling> | |
| <LogSDKReferenceResolutionErrorsAsWarnings>true</LogSDKReferenceResolutionErrorsAsWarnings> | |
| <RuntimeIdentifier Condition="'$(Platform)' == 'x86'">win-x86</RuntimeIdentifier> | |
| <RuntimeIdentifier Condition="'$(Platform)' == 'win32'">win-x86</RuntimeIdentifier> | |
| <RuntimeIdentifier Condition="'$(Platform)' == 'x64'">win-x64</RuntimeIdentifier> | |
| <RuntimeIdentifier Condition="'$(Platform)' == 'arm64'">win-arm64</RuntimeIdentifier> | |
| <_PublishProfileFileName>win-$(Platform).pubxml</_PublishProfileFileName> | |
| <PublishProfile Condition="'$(_PublishProfileFileName)' != '' and Exists('$(MSBuildProjectDirectory)\Properties\PublishProfiles\$(_PublishProfileFileName)')">$(_PublishProfileFileName)</PublishProfile> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Runtime.InteropServices; | |
| public static class DeviceFamilyInfoHelper | |
| { | |
| private static nint pGetDeviceFamilyInfo; | |
| static DeviceFamilyInfoHelper() | |
| { | |
| if (!NativeLibrary.TryLoad("ntdll.dll", out var handle) | |
| || !NativeLibrary.TryGetExport(handle, "RtlGetDeviceFamilyInfoEnum", out pGetDeviceFamilyInfo)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections; | |
| using System.Collections.Concurrent; | |
| using System.Diagnostics.CodeAnalysis; | |
| using System.Numerics; | |
| using System.Runtime.CompilerServices; | |
| using System.Runtime.InteropServices; | |
| using System.Runtime.InteropServices.Marshalling; | |
| using Windows.UI.Composition; | |
| using WinRT; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class TextBlockExtensions | |
| { | |
| // https://github.com/microsoft/microsoft-ui-xaml/blob/main/src/dxaml/xcp/core/text/TextBlock/TextBlockView.cpp#L606 | |
| public static TextPointer GetAdjustedPosition(this TextBlock textBlock, int charIndex) | |
| { | |
| const int PlaceHolderPositionsForInlines = 2; | |
| var contentLength = textBlock.Text.Length + 2 * PlaceHolderPositionsForInlines; | |
| int charCount = charIndex; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ContentExternalBackdropLink : IDisposable | |
| { | |
| private ObjectReference<IContentExternalBackdropLinkVftbl> _IContentExternalBackdropLink; | |
| private WinRT.IObjectReference _ICompositionSupportsSystemBackdrop; | |
| public unsafe static ContentExternalBackdropLink Create(Microsoft.UI.Composition.Compositor compositor) | |
| { | |
| var pCompositor = ((IWinRTObject)compositor).NativeObject.ThisPtr; | |
| nint ppv = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Text.Json; | |
| var data = LoadIdioms(); | |
| Console.WriteLine(""" | |
| 使用空格分割四字的个匹配,支持以下模式: | |
| 汉字:精确匹配 | |
| 字母:模糊匹配拼音 | |
| 字母+感叹号:精确匹配拼音 | |
| 数字:音调,可以追加到字母后面,如sheng!1 | |
| 下划线:忽略 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Runtime.InteropServices; | |
| using System; | |
| using Windows.Win32.Foundation; | |
| using Windows.Win32.System.Com; | |
| using System.Runtime.CompilerServices; | |
| using System.IO; | |
| using Windows.Win32; | |
| using System.Collections; | |
| using CsWin32ComWrappersTest; | |
| using System.Security.Cryptography; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Windows.Data.Xml.Dom; | |
| using Windows.UI.Notifications; | |
| // Edge Package AUMID | |
| const string AUMID = "Microsoft.MicrosoftEdge.Stable_8wekyb3d8bbwe!App"; | |
| var notifier = ToastNotificationManager.CreateToastNotifier(AUMID); | |
| var xml = $$$""" | |
| <toast launch='{{{BuildLaunchId(new Uri("https://www.4399.com/"))}}}'> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Runtime.CompilerServices; | |
| using System.Runtime.InteropServices; | |
| using Windows.UI.Composition; | |
| using WinRT; | |
| public static class CompositionPathFactory | |
| { | |
| private static ref readonly Guid IID_ICompositionPathFactory | |
| { | |
| [MethodImpl(MethodImplOptions.AggressiveInlining)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class FlipViewHelper | |
| { | |
| public static bool GetAllowPointerWheelFlip(FlipView obj) | |
| { | |
| return (bool)obj.GetValue(AllowPointerWheelFlipProperty); | |
| } | |
| public static void SetAllowPointerWheelFlip(FlipView obj, bool value) | |
| { | |
| obj.SetValue(AllowPointerWheelFlipProperty, value); |
NewerOlder