-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
92 changed files
with
1,267 additions
and
786 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
framework/Furion.Pure/V5_Experience/Core/Extensions/EventHandlerExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// ------------------------------------------------------------------------ | ||
// 版权信息 | ||
// 版权归百小僧及百签科技(广东)有限公司所有。 | ||
// 所有权利保留。 | ||
// 官方网站:https://baiqian.com | ||
// | ||
// 许可证信息 | ||
// Furion 项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。 | ||
// 许可证的完整文本可以在源代码树根目录中的 LICENSE-APACHE 和 LICENSE-MIT 文件中找到。 | ||
// 官方网站:https://furion.net | ||
// | ||
// 使用条款 | ||
// 使用本代码应遵守相关法律法规和许可证的要求。 | ||
// | ||
// 免责声明 | ||
// 对于因使用本代码而产生的任何直接、间接、偶然、特殊或后果性损害,我们不承担任何责任。 | ||
// | ||
// 其他重要信息 | ||
// Furion 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。 | ||
// 有关 Furion 项目的其他详细信息,请参阅位于源代码树根目录中的 COPYRIGHT 和 DISCLAIMER 文件。 | ||
// | ||
// 更多信息 | ||
// 请访问 https://gitee.com/dotnetchina/Furion 获取更多关于 Furion 项目的许可证和版权信息。 | ||
// ------------------------------------------------------------------------ | ||
|
||
namespace Furion.Extensions; | ||
|
||
/// <summary> | ||
/// <see cref="EventHandler{TEventArgs}" /> 拓展类 | ||
/// </summary> | ||
internal static class EventHandlerExtensions | ||
{ | ||
/// <summary> | ||
/// 尝试执行事件处理程序 | ||
/// </summary> | ||
/// <param name="handler"> | ||
/// <see cref="EventHandler{TEventArgs}" /> | ||
/// </param> | ||
/// <param name="sender"> | ||
/// <see cref="object" /> | ||
/// </param> | ||
/// <param name="args"> | ||
/// <typeparamref name="TEventArgs" /> | ||
/// </param> | ||
/// <typeparam name="TEventArgs">事件参数</typeparam> | ||
internal static void TryInvoke<TEventArgs>(this EventHandler<TEventArgs>? handler, object? sender, TEventArgs args) | ||
{ | ||
// 空检查 | ||
if (handler is null) | ||
{ | ||
return; | ||
} | ||
|
||
try | ||
{ | ||
handler(sender, args); | ||
} | ||
catch (Exception e) | ||
{ | ||
// 输出调试事件 | ||
Debugging.Error(e.Message); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.