public NotificationsHub(NavigationManager navigationManager)
        {
            _connection = new HubConnectionBuilder().WithUrl(navigationManager.ToAbsoluteUri("api/NotificationsHub")).WithAutomaticReconnect(new HubReconnectPolicy()).Build();
            _connection.StartAsync();

            _connection.On("DeviceStateChanged", (string deviceId) => {
                DeviceStateChanged?.Invoke(deviceId);
            });

            _connection.On("DevicePropertyChanged", (string propertyPath) => {
                DevicePropertyChanged?.Invoke(propertyPath);
            });

            _connection.On("DashboardConfigurationChanged", () => {
                DashboardConfigurationChanged?.Invoke();
            });
        }
        /// <summary>
        /// The OnPropertyValueChanged method indicates that the value of a property belonging to an
        /// audio endpoint device has changed.
        /// </summary>
        /// <param name="deviceId">The device id that identifies the audio endpoint device.</param>
        /// <param name="key">The <see cref="Win32.PropertyKey"/> that specifies the changed property.</param>
        /// <returns>HRESULT</returns>
        void IMMNotificationClient.OnPropertyValueChanged(string deviceId, PropertyKey key)
        {
            DevicePropertyChanged?.Invoke(this, new DevicePropertyChangedEventArgs(deviceId, key));

            //return (int) HResult.S_OK;
        }
Beispiel #3
0
 private void Device_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     DevicePropertyChanged?.Invoke((IAudioDevice)sender, e.PropertyName);
 }