public void Init()
 {
     _model.DefaultDeviceChanged        += ModelOnDefaultDeviceChanged;
     _model.NotificationSettingsChanged += ModelOnNotificationSettingsChanged;
     _notification = NotificationFactory.CreateNotification(_model.NotificationSettings, _model.NotifyIcon,
                                                            _model.NotificationSound);
 }
Example #2
0
 private void SetNotification(NotificationTypeEnum notificationTypeEnum)
 {
     try
     {
         _notification = NotificationFactory.CreateNotification(notificationTypeEnum);
     }
     catch (CachedSoundFileNotExistsException)
     {
         MessageBox.Show(string.Format(Properties.Notifications.AudioFileNotFound, Application.ProductName,
                                       Properties.Notifications.NotifSound), Properties.Notifications.AudioFileNotFoundTitle,
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
         _model.NotificationSettings = NotificationTypeEnum.SoundNotification;
     }
 }
 private void ModelOnNotificationSettingsChanged(object sender, NotificationSettingsUpdatedEvent notificationSettingsUpdatedEvent)
 {
     _notification = NotificationFactory.CreateNotification(notificationSettingsUpdatedEvent.NewSettings, _model.NotifyIcon,
                                                            _model.NotificationSound);
 }