mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
This upgrades to [v0.0.24](https://github.com/check-spelling/check-spelling/releases/tag/v0.0.24). A number of GitHub APIs are being turned off shortly, so you need to upgrade or various uncertain outcomes will occur. There's a new accessibility forbidden pattern: > Do not use `(click) here` links > For more information, see: > * https://www.w3.org/QA/Tips/noClickHere > * https://webaim.org/techniques/hypertext/link_text > * https://granicus.com/blog/why-click-here-links-are-bad/ > * https://heyoka.medium.com/dont-use-click-here-f32f445d1021 ```pl (?i)(?:>|\[)(?:(?:click |)here|link|(?:read |)more)(?:</|\]\() ``` There are some minor bugs that I'm aware of and which I've fixed since this release, but I don't expect to make another release this month. I've added a pair of patterns for includes and pragmas. My argument is that the **compiler** will _generally_ tell you if you've misspelled an include and the **linker** will _generally_ tell you if you misspell a lib. - There's a caveat here: If your include case-insensitively matches the referenced file (but doesn't properly match it), then unless you either use a case-sensitive file system (as opposed to case-preserving) or beg clang to warn, you won't notice when you make this specific mistake -- this matters in that a couple of Windows headers (e.g. Unknwn.h) have particular case and repositories don't tend to consistently/properly write them.
56 lines
1.8 KiB
C#
56 lines
1.8 KiB
C#
// 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.
|
|
using System.Runtime.CompilerServices;
|
|
|
|
[assembly: InternalsVisibleTo("Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests")]
|
|
|
|
namespace Microsoft.PowerToys.Run.Plugin.TimeDate.Components
|
|
{
|
|
internal class AvailableResult
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets the time/date value
|
|
/// </summary>
|
|
internal string Value { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the text used for the subtitle and as search term
|
|
/// </summary>
|
|
internal string Label { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets an alternative search tag that will be evaluated if label doesn't match. For example we like to show the era on searches for 'year' too.
|
|
/// </summary>
|
|
internal string AlternativeSearchTag { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets a value indicating the type of result
|
|
/// </summary>
|
|
internal ResultIconType IconType { get; set; }
|
|
|
|
/// <summary>
|
|
/// Returns the path to the icon
|
|
/// </summary>
|
|
/// <param name="theme">Theme</param>
|
|
/// <returns>Path</returns>
|
|
internal string GetIconPath(string theme)
|
|
{
|
|
return IconType switch
|
|
{
|
|
ResultIconType.Time => $"Images\\time.{theme}.png",
|
|
ResultIconType.Date => $"Images\\calendar.{theme}.png",
|
|
ResultIconType.DateTime => $"Images\\timeDate.{theme}.png",
|
|
_ => string.Empty,
|
|
};
|
|
}
|
|
}
|
|
|
|
internal enum ResultIconType
|
|
{
|
|
Time,
|
|
Date,
|
|
DateTime,
|
|
}
|
|
}
|