😊 修复 在 WinForm 中将组件作为事件总线处理程序不能更新 UI 线程问题 #IAT1JG

* 升级 `Swagger` 至 `v6.8.0`
This commit is contained in:
百小僧
2024-09-23 18:13:53 +08:00
parent 7632fc3907
commit becd41029c
10 changed files with 22 additions and 8 deletions

View File

@@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="xunit.extensibility.execution" Version="2.9.0" />
<PackageReference Include="xunit.extensibility.execution" Version="2.9.1" />
</ItemGroup>
<ItemGroup>

View File

@@ -24,6 +24,7 @@
// ------------------------------------------------------------------------
using Furion;
using Furion.EventBus;
using Microsoft.Extensions.DependencyInjection;
using System.Net.NetworkInformation;
using System.Reflection;
@@ -57,6 +58,12 @@ public static class Native
/// <returns></returns>
public static object CreateInstance(Type windowType, params object[] parameters)
{
// 解决特定案例控件本身也是事件处理程序https://gitee.com/dotnetchina/Furion/issues/IAT1JG
if (typeof(IEventSubscriber).IsAssignableFrom(windowType))
{
return App.RootServices.GetServices(typeof(IEventSubscriber)).FirstOrDefault(s => s.GetType() == windowType);
}
// 获取构造函数
var constructors = windowType.GetConstructors(BindingFlags.Public | BindingFlags.Instance);

View File

@@ -286,7 +286,7 @@ public sealed class EventBusOptionsBuilder
// 注册事件订阅者
foreach (var eventSubscriber in _eventSubscribers)
{
services.AddSingleton(typeof(IEventSubscriber), eventSubscriber);
services.TryAddEnumerable(ServiceDescriptor.Singleton(typeof(IEventSubscriber), eventSubscriber));
}
// 替换事件发布者

View File

@@ -26,7 +26,7 @@
<ItemGroup>
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.3.8" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.0" />
</ItemGroup>
<ItemGroup>

View File

@@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="xunit.extensibility.execution" Version="2.9.0" />
<PackageReference Include="xunit.extensibility.execution" Version="2.9.1" />
</ItemGroup>
<ItemGroup>

View File

@@ -24,6 +24,7 @@
// ------------------------------------------------------------------------
using Furion;
using Furion.EventBus;
using Microsoft.Extensions.DependencyInjection;
using System.Net.NetworkInformation;
using System.Reflection;
@@ -57,6 +58,12 @@ public static class Native
/// <returns></returns>
public static object CreateInstance(Type windowType, params object[] parameters)
{
// 解决特定案例控件本身也是事件处理程序https://gitee.com/dotnetchina/Furion/issues/IAT1JG
if (typeof(IEventSubscriber).IsAssignableFrom(windowType))
{
return App.RootServices.GetServices(typeof(IEventSubscriber)).FirstOrDefault(s => s.GetType() == windowType);
}
// 获取构造函数
var constructors = windowType.GetConstructors(BindingFlags.Public | BindingFlags.Instance);

View File

@@ -286,7 +286,7 @@ public sealed class EventBusOptionsBuilder
// 注册事件订阅者
foreach (var eventSubscriber in _eventSubscribers)
{
services.AddSingleton(typeof(IEventSubscriber), eventSubscriber);
services.TryAddEnumerable(ServiceDescriptor.Singleton(typeof(IEventSubscriber), eventSubscriber));
}
// 替换事件发布者

View File

@@ -26,7 +26,7 @@
<ItemGroup>
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.3.8" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.3" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.0" />
</ItemGroup>
<ItemGroup>

View File

@@ -10,7 +10,7 @@
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.8" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="System.Text.Json" Version="8.0.4" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit" Version="2.9.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>

View File

@@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit" Version="2.9.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>