Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Examples - Remove null checks since Node is now used
Browse files Browse the repository at this point in the history
  • Loading branch information
fsobolev committed Oct 2, 2023
1 parent 9b5dbc9 commit 346e1b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions Examples/Avalonia/Views/PlayerView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Examples/GirCore/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 346e1b6

Please sign in to comment.