Damn garbage collector

This commit is contained in:
TheXamlGuy
2024-01-15 22:02:30 +00:00
parent 2a494e1b94
commit f0ef3d1604
47 changed files with 452 additions and 257 deletions
@@ -0,0 +1,17 @@
using Windows.Media.Control;
namespace Hyperbar.Windows.MediaController;
public class MediaControllerFactory(IServiceScopeFactory<MediaController> serviceScopeFactory) :
IFactory<GlobalSystemMediaTransportControlsSession, MediaController?>
{
public MediaController? Create(GlobalSystemMediaTransportControlsSession value)
{
if (serviceScopeFactory.Create(value) is MediaController mediaController)
{
return mediaController;
}
return default;
}
}