make some projects compatible with netframework4.8 again
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
|
||||
<StartupObject />
|
||||
<TargetFrameworks>net8.0</TargetFrameworks>
|
||||
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
@@ -41,7 +41,7 @@ public static class Helpers
|
||||
var dateTime = DateTime.UtcNow.ToString("yyyyMMddHHmmssfffffff");
|
||||
var type = typeof(T).ToString();
|
||||
var together = sn + dateTime + type + var;
|
||||
var hash = BitConverter.ToString(MD5.HashData(Encoding.Default.GetBytes(together))).Replace("-", string.Empty);
|
||||
var hash = BitConverter.ToString(new HMACMD5().ComputeHash(Encoding.Default.GetBytes(together))).Replace("-", string.Empty);
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net8.0</TargetFrameworks>
|
||||
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworks>net8.0-windows</TargetFrameworks>
|
||||
<TargetFrameworks>net8.0-windows;netframework4.8</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
<DocumentationFile>Pilz.Drawing.xml</DocumentationFile>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
@@ -26,7 +27,7 @@
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<Version>2.0.1</Version>
|
||||
<Version>2.0.2</Version>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net8.0</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Version>2.1.0</Version>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>annotations</ImplicitUsings>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net8.0</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net8.0-windows</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net8.0-windows</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net8.0</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net8.0</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<StartupObject />
|
||||
<RootNamespace>Pilz.S3DFileParser</RootNamespace>
|
||||
<TargetFrameworks>net8.0</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
<DocumentationFile>Pilz.Simple3DFileParser.xml</DocumentationFile>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworks>net6.0-windows;net8.0-windows</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0-windows;net8.0-windows;netframework4.8</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
<DocumentationFile>Pilz.Threading.xml</DocumentationFile>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -84,11 +84,6 @@ public partial class FlyoutBase : UserControl
|
||||
ParentChanged += FlyoutBase_ParentChanged;
|
||||
}
|
||||
|
||||
[MemberNotNull(nameof(tableLayoutPanel_TitlePanel))]
|
||||
[MemberNotNull(nameof(label_Title))]
|
||||
[MemberNotNull(nameof(tableLayoutPanel_ActionPanel))]
|
||||
[MemberNotNull(nameof(button_Cancel))]
|
||||
[MemberNotNull(nameof(button_Accept))]
|
||||
private void InitializeComponent()
|
||||
{
|
||||
// button_Accept
|
||||
@@ -180,7 +175,7 @@ public partial class FlyoutBase : UserControl
|
||||
base.OnLoad(e);
|
||||
}
|
||||
|
||||
private void FlyoutBase_ParentChanged(object? sender, EventArgs e)
|
||||
private void FlyoutBase_ParentChanged(object sender, EventArgs e)
|
||||
{
|
||||
var frm = FindForm();
|
||||
if (frm != null)
|
||||
@@ -214,13 +209,13 @@ public partial class FlyoutBase : UserControl
|
||||
tableLayoutPanel_TitlePanel.Visible = !string.IsNullOrWhiteSpace(label_Title.Text);
|
||||
}
|
||||
|
||||
protected virtual void Button_Accept_Click(object? sender, EventArgs e)
|
||||
protected virtual void Button_Accept_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (ValidateOK())
|
||||
Close(DialogResult.OK);
|
||||
}
|
||||
|
||||
protected virtual void Button_Cancel_Click(object? sender, EventArgs e)
|
||||
protected virtual void Button_Cancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
Close(DialogResult.Cancel);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Pilz.UI.Extensions;
|
||||
|
||||
public static class FlyoutBaseExtensions
|
||||
{
|
||||
public static bool IsValid([NotNullWhen(true)] this FlyoutBase? @this)
|
||||
public static bool IsValid(this FlyoutBase? @this)
|
||||
{
|
||||
return @this != null && @this.Result == DialogResult.OK;
|
||||
}
|
||||
|
||||
@@ -225,7 +225,7 @@ internal class HighlightPanel : Control
|
||||
Pilz.Win32.Native.User32.GetWindowRect(control.Handle, ref rect);
|
||||
var pp = control.Parent.PointToClient(new Point(rect.Left + 3, rect.Top + 3));
|
||||
var handle = Pilz.Win32.Native.User32.ChildWindowFromPointEx(control.Parent.Handle, new Pilz.Win32.Native.POINT(pp.X, pp.Y), (uint)Pilz.Win32.Native.WindowFromPointFlags.CWP_SKIPINVISIBLE);
|
||||
if (handle == nint.Zero)
|
||||
if (handle == IntPtr.Zero)
|
||||
return control.Visible;
|
||||
var c = Control.FromHandle(handle);
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Microsoft.VisualBasic.CompilerServices;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
@@ -81,7 +80,7 @@ public class Highlighter : Component
|
||||
|
||||
private void ControlHighlightVisibleChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (_HighlightPanel is not null && Conversions.ToBoolean(Operators.ConditionalCompareObjectEqual(_HighlightPanel.FocusHighlightControl, sender, false)))
|
||||
if (_HighlightPanel is not null && sender.Equals(_HighlightPanel.FocusHighlightControl))
|
||||
UpdateHighlighterRegion();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Microsoft.VisualBasic.CompilerServices;
|
||||
using Pilz.Drawing;
|
||||
using Pilz.Drawing;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@@ -94,7 +93,7 @@ public class PaintingControl : UserControl, IPaintingObjectContainer
|
||||
{
|
||||
get
|
||||
{
|
||||
return Conversions.ToInteger(GetType().GetField("layoutSuspendCount", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(this)) != 0;
|
||||
return Convert.ToInt32(GetType().GetField("layoutSuspendCount", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).GetValue(this)) != 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -545,8 +544,8 @@ public class PaintingControl : UserControl, IPaintingObjectContainer
|
||||
/// <param name="m"></param>
|
||||
protected override void WndProc(ref Message m)
|
||||
{
|
||||
const int WM_NCHITTEST = 0x84;
|
||||
const int HTTRANSPARENT = -1;
|
||||
const nint WM_NCHITTEST = 0x84;
|
||||
const nint HTTRANSPARENT = -1;
|
||||
|
||||
if (!VisibleForMouseEvents && m.Msg == WM_NCHITTEST)
|
||||
m.Result = HTTRANSPARENT;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Microsoft.VisualBasic.CompilerServices;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
@@ -590,7 +589,7 @@ public class PaintingObject : ICloneable, IPaintingObjectContainer
|
||||
get
|
||||
{
|
||||
if (Tag is string)
|
||||
return Conversions.ToString(Tag);
|
||||
return Convert.ToString(Tag);
|
||||
else
|
||||
{
|
||||
return string.Empty;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<MyType>Windows</MyType>
|
||||
<TargetFrameworks>net8.0-windows</TargetFrameworks>
|
||||
<TargetFrameworks>net8.0-windows;netframework4.8</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<DocumentationFile>Pilz.UI.xml</DocumentationFile>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<DefaultItemExcludes>$(DefaultItemExcludes);$(ProjectDir)**\*.vb</DefaultItemExcludes>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Nullable>annotations</Nullable>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<Version>2.4.5</Version>
|
||||
<Version>2.4.6</Version>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
|
||||
1
Pilz.UI/Resources.Designer.cs
generated
1
Pilz.UI/Resources.Designer.cs
generated
@@ -25,7 +25,6 @@ namespace Pilz.UI.My.Resources
|
||||
[System.CodeDom.Compiler.GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[DebuggerNonUserCode()]
|
||||
[System.Runtime.CompilerServices.CompilerGenerated()]
|
||||
[HideModuleName()]
|
||||
internal static class Resources
|
||||
{
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
|
||||
using Microsoft.VisualBasic.CompilerServices;
|
||||
using Pilz.Win32.Native;
|
||||
using Pilz.Win32.Native;
|
||||
using Keys = System.Windows.Forms.Keys;
|
||||
|
||||
namespace Pilz.Win32.Mapped;
|
||||
@@ -11,7 +9,7 @@ public class Keyboard
|
||||
|
||||
public static bool IsKeyDown(int keyCode)
|
||||
{
|
||||
return Conversions.ToDouble(User32.GetKeyState(keyCode).ToString() + 0x8000) < 0d;
|
||||
return Convert.ToDouble(User32.GetKeyState(keyCode).ToString() + 0x8000) < 0d;
|
||||
}
|
||||
|
||||
public static bool IsKeyDown(Keys keyCode)
|
||||
|
||||
@@ -8,8 +8,10 @@ public static class NativeTools
|
||||
[Obsolete("Use \"Environment.ProcessPath\" instead.")]
|
||||
public static string GetExecutablePath(bool checkRealOS = false)
|
||||
{
|
||||
#if NET8_0_OR_GREATER
|
||||
if (RuntimeInformationsEx.IsOSPlatform(OSType.Windows, checkRealOS))
|
||||
return Environment.ProcessPath;
|
||||
#endif
|
||||
return Process.GetCurrentProcess().MainModule.FileName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net8.0-windows</TargetFrameworks>
|
||||
<TargetFrameworks>net8.0-windows;netframework4.8</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<Version>2.1.0</Version>
|
||||
<Version>2.1.1</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>annotations</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -66,7 +66,7 @@ public class AppVersion(Version version, int build, AppChannel channel) : ICompa
|
||||
throw new FormatException();
|
||||
|
||||
if (input.StartsWith("version", StringComparison.InvariantCultureIgnoreCase))
|
||||
input = input[7..];
|
||||
input = input.Substring(7);
|
||||
|
||||
var splitted = input.Trim().Split(' ');
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net8.0</TargetFrameworks>
|
||||
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>annotations</Nullable>
|
||||
<Version>2.3.0</Version>
|
||||
<Version>2.3.1</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user