From 482c92f98eaa9a186b3feb0df47d6eea8917291b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20M=C3=A1rkus?= Date: Sat, 20 Jan 2024 12:15:29 +0100 Subject: [PATCH] Addressing warnings. --- .../TagHelpers/BootstrapSplitButtonTagHelper.cs | 12 +++--------- Lombiq.UIKit/TagHelpers/EditorTagHelper.cs | 5 +---- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/Lombiq.UIKit/TagHelpers/BootstrapSplitButtonTagHelper.cs b/Lombiq.UIKit/TagHelpers/BootstrapSplitButtonTagHelper.cs index 22bb246..0d509cf 100644 --- a/Lombiq.UIKit/TagHelpers/BootstrapSplitButtonTagHelper.cs +++ b/Lombiq.UIKit/TagHelpers/BootstrapSplitButtonTagHelper.cs @@ -6,10 +6,10 @@ namespace Lombiq.UIKit.TagHelpers; [HtmlTargetElement("bootstrap-split-button", Attributes = "options")] -public class BootstrapSplitButtonTagHelper : TagHelper +public class BootstrapSplitButtonTagHelper(IDisplayHelper displayHelper, IShapeFactory factory) : TagHelper { - private readonly IDisplayHelper _displayHelper; - private readonly IShapeFactory _shapeFactory; + private readonly IDisplayHelper _displayHelper = displayHelper; + private readonly IShapeFactory _shapeFactory = factory; [HtmlAttributeName("type")] public string Type { get; set; } @@ -32,12 +32,6 @@ public class BootstrapSplitButtonTagHelper : TagHelper [HtmlAttributeName("options")] public IEnumerable<(string Url, string Text)> Options { get; set; } - public BootstrapSplitButtonTagHelper(IDisplayHelper displayHelper, IShapeFactory factory) - { - _displayHelper = displayHelper; - _shapeFactory = factory; - } - public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { IShape shape = await _shapeFactory.New.BootstrapSplitButton( diff --git a/Lombiq.UIKit/TagHelpers/EditorTagHelper.cs b/Lombiq.UIKit/TagHelpers/EditorTagHelper.cs index 39151ee..5ed698a 100644 --- a/Lombiq.UIKit/TagHelpers/EditorTagHelper.cs +++ b/Lombiq.UIKit/TagHelpers/EditorTagHelper.cs @@ -12,7 +12,7 @@ namespace Lombiq.UIKit.TagHelpers; [HtmlTargetElement("editor", Attributes = nameof(Type) + "," + nameof(For))] -public class EditorTagHelper : BaseShapeTagHelper +public class EditorTagHelper(IShapeFactory shapeFactory, IDisplayHelper displayHelper) : BaseShapeTagHelper(shapeFactory, displayHelper) { private const string UIKitEditorBaseName = "UIKit__Editor__"; @@ -76,9 +76,6 @@ public class EditorTagHelper : BaseShapeTagHelper [HtmlAttributeName(nameof(HideSelectedFromDropdownList))] public bool HideSelectedFromDropdownList { get; set; } - public EditorTagHelper(IShapeFactory shapeFactory, IDisplayHelper displayHelper) - : base(shapeFactory, displayHelper) { } - public override Task ProcessAsync(TagHelperContext tagHelperContext, TagHelperOutput output) { Type = UIKitEditorBaseName + Type;