From 346e1b6874a85b1a6fd2fec807ca979c0223608c Mon Sep 17 00:00:00 2001 From: Fyodor Sobolev <117388856+fsobolev@users.noreply.github.com> Date: Mon, 2 Oct 2023 17:46:09 +0300 Subject: [PATCH] Examples - Remove null checks since Node is now used --- Examples/Avalonia/Views/PlayerView.axaml.cs | 8 ++------ Examples/GirCore/MainWindow.cs | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Examples/Avalonia/Views/PlayerView.axaml.cs b/Examples/Avalonia/Views/PlayerView.axaml.cs index 0c86352..04dd00a 100644 --- a/Examples/Avalonia/Views/PlayerView.axaml.cs +++ b/Examples/Avalonia/Views/PlayerView.axaml.cs @@ -23,17 +23,13 @@ public PlayerView() public void OnMPVPropertyChanged(object? sender, PropertyChangedEventArgs e) { - if (e.Node == null) - { - return; - } switch (e.Name) { case "pause": - PauseButton.Content = (bool)e.Node! ? "Paused" : "Playing"; + PauseButton.Content = (bool)e.Node ? "Paused" : "Playing"; break; case "time-pos": - TimeLabel.Text = TimeSpan.FromSeconds((double)e.Node!).ToString(@"mm\:ss"); + TimeLabel.Text = TimeSpan.FromSeconds((double)e.Node).ToString(@"mm\:ss"); break; } } diff --git a/Examples/GirCore/MainWindow.cs b/Examples/GirCore/MainWindow.cs index 199e4a7..4ef3c5e 100644 --- a/Examples/GirCore/MainWindow.cs +++ b/Examples/GirCore/MainWindow.cs @@ -46,11 +46,11 @@ public MainWindow(Gtk.Application application) { if (e.Name == "pause") { - pauseButton.SetIconName((bool)e.Node! ? "media-playback-start-symbolic" : "media-playback-pause-symbolic"); + pauseButton.SetIconName((bool)e.Node ? "media-playback-start-symbolic" : "media-playback-pause-symbolic"); } if (e.Name == "media-title") { - title.SetLabel((string)e.Node!); + title.SetLabel((string)e.Node); } }; _player.ObserveProperty("pause");