Turned getter-like extension methods into extension properties (#1157)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-04 13:00:56 +01:00
1 parent 0375318b1b
commit f649febf88
286 files changed
+1379 -1109

No files matched your search

@@ -8,13 +8,13 @@
@foreach (var source in Enum.GetValues<IconSources>())
{
<MudSelectItem Value="@source">
@source.Name()
@source.Name
</MudSelectItem>
}
</MudSelect>
@if (this.selectedIconSource is not IconSources.GENERIC)
{
<MudButton Href="@this.selectedIconSource.URL()" Target="_blank" Variant="Variant.Filled" Size="Size.Medium">
<MudButton Href="@this.selectedIconSource.URL" Target="_blank" Variant="Variant.Filled" Size="Size.Medium">
@T("Open website")
</MudButton>
}
@@ -31,7 +31,7 @@ public partial class AssistantIconFinder : AssistantBaseCore<SettingsDialogIconF
protected override string SendToChatVisibleUserPromptText =>
$"""
{string.Format(T("Find icon suggestions on {0} for the following context:"), this.selectedIconSource.Name())}
{string.Format(T("Find icon suggestions on {0} for the following context:"), this.selectedIconSource.Name)}
{this.inputContext}
""";
@@ -98,7 +98,7 @@ public partial class AssistantIconFinder : AssistantBaseCore<SettingsDialogIconF
this.CreateChatThread();
var time = this.AddUserRequest(
$"""
{this.selectedIconSource.Prompt()} I search for an icon for the following context:
{this.selectedIconSource.Prompt} I search for an icon for the following context:
```
{this.inputContext}
@@ -4,7 +4,7 @@ public static class IconSourceExtensions
{
extension(IconSources iconSource)
{
public string Name() => iconSource switch
public string Name => iconSource switch
{
IconSources.FLAT_ICON => "Flaticon",
IconSources.FONT_AWESOME => "Font Awesome",
@@ -16,7 +16,7 @@ public static class IconSourceExtensions
_ => "Generic",
};
public string Prompt() => iconSource switch
public string Prompt => iconSource switch
{
IconSources.FLAT_ICON => "My icon source is Flaticon.",
IconSources.FONT_AWESOME => "I look for an icon on Font Awesome. Please provide just valid icon names. Valid icon names are using the format `fa-icon-name`.",
@@ -28,7 +28,7 @@ public static class IconSourceExtensions
_ => string.Empty,
};
public string URL() => iconSource switch
public string URL => iconSource switch
{
IconSources.FLAT_ICON => "https://www.flaticon.com/",
IconSources.FONT_AWESOME => "https://fontawesome.com/",