public void Handle(StatusChangedNotification notification) { Toggle(notification.State.IsLocalChokingRemote, notification.Peer, LocalChoking); Toggle(notification.State.IsLocalInterestedInRemote, notification.Peer, LocalInterested); Toggle(notification.State.IsRemoteChokingLocal, notification.Peer, RemoteChoking); Toggle(notification.State.IsRemoteInterestedInLocal, notification.Peer, RemoteInterested); }
protected override void OnPropertyChanged(PropertyChangedEventArgs e) { base.OnPropertyChanged(e); if (e.PropertyName.Equals(nameof(Status)) && Status != PreviousStatus) { _ = WidgetNotifications.PublishAsync(StatusChangedNotification.Create(this)); } }
protected override void Handle(StatusChangedNotification <TWidget> notification) { var message = $"Widget '{notification.Widget.Name}' status changed from {notification.Widget.PreviousStatus?.Metadata?.DisplayName} to {notification.Widget.Status?.Metadata?.DisplayName}."; _logger.LogDebug(message); if (notification.Widget.NotificationsSettings?.IsEnabled == true && notification.Widget.PreviousStatus != Status.None) { _notificationService.Send(new Notification(message, notification.Widget.Name)); } }
protected override void Handle(StatusChangedNotification <TWidget> notification) { var message = $"Widget '{notification.Widget.Name}' status changed from {notification.Widget.PreviousStatus} to {notification.Widget.Status}."; if (_logger.IsEnabled(LogLevel.Trace)) { _logger.LogTrace(message); } if (notification.Widget.PreviousStatus != Status.None) { _notificationService.Send(new Notification(message, notification.Widget.Name)); } }
public virtual void Handle(StatusChangedNotification notification) { }
public override void Handle(StatusChangedNotification notification) { peers.Handle(notification); }