/// <summary> /// Checks if a process is running then activate the trigger, /// otherwise deactivate the trigger. /// </summary> private async Task CheckProcessAsync() { if (Process.GetProcessesByName(_processName).Length > 0) { await _eventTriggersCollection.ActivateTrigger(Priority); } else { await _eventTriggersCollection.DeactivateTrigger(Priority); } }
/// <summary> /// Checks if a playlist is being played in Spotify then execute TryStartEffect(), else stop the effect /// </summary> private async Task CheckPlaylistAsync() { if (SpotifyEventTimer.CurrentPlaylistId == _playlistId) { await _eventTriggersCollection.ActivateTrigger(Priority); } else { await _eventTriggersCollection.DeactivateTrigger(Priority); } }