mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-29 01:07:58 +01:00
Simplify InitializedChanged event accessor
- Remove unnecessary null check in custom event accessor - Directly access ApplicationImpl.Instance.InitializedChanged Co-authored-by: tig <585482+tig@users.noreply.github.com>
This commit is contained in:
@@ -251,17 +251,11 @@ public static partial class Application // Lifecycle (Init/Shutdown)
|
||||
{
|
||||
add
|
||||
{
|
||||
if (ApplicationImpl.Instance is ApplicationImpl impl)
|
||||
{
|
||||
impl.InitializedChanged += value;
|
||||
}
|
||||
ApplicationImpl.Instance.InitializedChanged += value;
|
||||
}
|
||||
remove
|
||||
{
|
||||
if (ApplicationImpl.Instance is ApplicationImpl impl)
|
||||
{
|
||||
impl.InitializedChanged -= value;
|
||||
}
|
||||
ApplicationImpl.Instance.InitializedChanged -= value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user