-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.vb
More file actions
60 lines (50 loc) · 2.11 KB
/
Copy pathProgram.vb
File metadata and controls
60 lines (50 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
''' <summary>
''' QueueMonitor - Applicazione per il monitoraggio delle code con gauge visuali
''' Punto di ingresso principale dell'applicazione
''' </summary>
''' <remarks>
''' Autore: QueueMonitor Pro
''' Versione: 1.0.0
''' Descrizione: Monitoraggio in tempo reale dei tempi di attesa delle code
''' tramite gauge grafici configurabili.
''' </remarks>
Imports System.Windows.Forms
''Namespace QueueMonitor
Public Module Program
''' <summary>
''' Punto di avvio dell'applicazione Windows Forms
''' </summary>
<STAThread>
Public Sub Main()
' Abilita stili visivi moderni di Windows
Application.EnableVisualStyles()
Application.SetCompatibleTextRenderingDefault(False)
' Imposta la gestione degli errori non gestiti
AddHandler Application.ThreadException, AddressOf Application_ThreadException
AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf CurrentDomain_UnhandledException
' Avvia la form principale (Dashboard)
Application.Run(New FormDashboard())
End Sub
''' <summary>
''' Gestione eccezioni non gestite nel thread UI
''' </summary>
Private Sub Application_ThreadException(sender As Object, e As Threading.ThreadExceptionEventArgs)
System.Windows.Forms.MessageBox.Show(
$"Errore imprevisto:{Environment.NewLine}{e.Exception.Message}",
"Errore - QueueMonitor",
System.Windows.Forms.MessageBoxButtons.OK,
System.Windows.Forms.MessageBoxIcon.Error)
End Sub
''' <summary>
''' Gestione eccezioni non gestite nel dominio applicazione
''' </summary>
Private Sub CurrentDomain_UnhandledException(sender As Object, e As UnhandledExceptionEventArgs)
Dim ex = TryCast(e.ExceptionObject, Exception)
System.Windows.Forms.MessageBox.Show(
$"Errore critico:{Environment.NewLine}{ex?.Message}",
"Errore Critico - QueueMonitor",
System.Windows.Forms.MessageBoxButtons.OK,
System.Windows.Forms.MessageBoxIcon.Error)
End Sub
End Module
''End Namespace