make some projects compatible with netframework4.8 again

This commit is contained in:
2025-02-11 07:18:14 +01:00
parent f08c94908a
commit 07ab60666a
32 changed files with 57 additions and 55 deletions

View File

@@ -100,11 +100,6 @@ public partial class RadFlyoutBase : UserControl
ParentChanged += FlyoutDialogBase_ParentChanged;
}
[MemberNotNull(nameof(radButton_Cancel))]
[MemberNotNull(nameof(radButton_Confirm))]
[MemberNotNull(nameof(tableLayoutPanel_ActionPanel))]
[MemberNotNull(nameof(tableLayoutPanel_TitlePanel))]
[MemberNotNull(nameof(radLabel_Title))]
private void InitializeComponent()
{
// radButton_Cancel

View File

@@ -5,7 +5,7 @@ namespace Pilz.UI.Telerik.Extensions.Extensions;
public static class RadFlyoutBaseExtensions
{
public static bool IsValid([NotNullWhen(true)] this RadFlyoutBase? @this)
public static bool IsValid(this RadFlyoutBase? @this)
{
return @this != null && @this.Result == DialogResult.OK;
}

View File

@@ -16,15 +16,16 @@ public static class RadListDataItemCollectionExtensions
public static IEnumerable<RadListDataItem> AddEnumValues<T>(this RadListDataItemCollection @this, bool clearCollection, Func<T, bool>? filter, Func<T, string?>? format) where T : struct, Enum
{
var values = Enum.GetValues<T>();
var values = Enum.GetValues(typeof(T));
var items = new List<RadListDataItem>();
format ??= v => Enum.GetName(v);
if (format == null)
format = v => Enum.GetName(typeof(T), v);
if (clearCollection)
@this.Clear();
foreach (var value in values)
foreach (T value in values)
{
if (filter is null || filter(value))
items.Add(new(format(value), value));

View File

@@ -1,14 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0-windows</TargetFrameworks>
<TargetFrameworks>net8.0-windows;netframework4.8</TargetFrameworks>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Nullable>annotations</Nullable>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
<PropertyGroup>
<Version>2.9.5</Version>
<Version>2.9.6</Version>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>