@@ -863,15 +863,21 @@ Public Class WinNUT
863
863
End If
864
864
End Sub
865
865
866
- Public Shared Sub Event_ChangeStatus() Handles Me .On_Battery, Me .On_Line,
867
- UPS_Device.Lost_Connect, UPS_Device.Connected, UPS_Device.Disconnected
868
-
869
- WinNUT.NotifyIcon.BalloonTipText = WinNUT.NotifyIcon.Text
870
- If WinNUT.AllowToast And WinNUT.NotifyIcon.BalloonTipText <> "" Then
871
- Dim Toastparts As String () = WinNUT.NotifyIcon.BalloonTipText.Split( New String () {Environment.NewLine}, StringSplitOptions.None)
872
- WinNUT.ToastPopup.SendToast(Toastparts)
873
- ElseIf WinNUT.NotifyIcon.Visible = True And WinNUT.NotifyIcon.BalloonTipText <> "" Then
874
- WinNUT.NotifyIcon.ShowBalloonTip( 10000 )
866
+ ''' <summary>
867
+ ''' Handle Toast (Windows 10+) and/or NotifyIcon pop-ups.
868
+ ''' </summary>
869
+ Private Sub ToastNotifyIcon() Handles Me .On_Battery, Me .On_Line, UPS_Device.Lost_Connect,
870
+ UPS_Device.Connected, UPS_Device.Disconnected
871
+
872
+ LogFile.LogTracing( "ToastNotifyIcon running." , LogLvl.LOG_DEBUG, Me )
873
+ NotifyIcon.BalloonTipText = NotifyIcon.Text
874
+ If AllowToast And NotifyIcon.BalloonTipText <> "" Then
875
+ Dim Toastparts As String () = NotifyIcon.BalloonTipText.Split( New String () {Environment.NewLine}, StringSplitOptions.None)
876
+ LogFile.LogTracing( "Sending Toast popup with text: " & NotifyIcon.BalloonTipText, LogLvl.LOG_DEBUG, Me )
877
+ ToastPopup.SendToast(Toastparts)
878
+ ElseIf NotifyIcon.Visible = True And NotifyIcon.BalloonTipText <> "" Then
879
+ LogFile.LogTracing( "Sending NotifyIcon ballowtip: " & NotifyIcon.BalloonTipText, LogLvl.LOG_DEBUG, Me )
880
+ NotifyIcon.ShowBalloonTip( 10000 )
875
881
End If
876
882
End Sub
877
883
0 commit comments